view release on metacpan or search on metacpan
lib/Test/Mimic.pm view on Meta::CPAN
# Record the missing packages.
if ( @to_record != 0 ) {
$recording_required = 1;
require Test::Mimic::Recorder;
my %recorder_prefs = %preferences;
#Only include those packages that need recording.
$recorder_prefs{'packages'} = {};
for my $package (@to_record) {
$recorder_prefs{'packages'}->{$package} = $preferences{'packages'}->{$package};
}
Test::Mimic::Recorder->import(\%recorder_prefs);
}
}
# Handles the code generation after the recording is complete.
# NOTE: This relies on the LIFO structure of END block execution.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e "$ENV{HOME}/.svk") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
t/logs/rtc-126010/smokecurrent.log view on Meta::CPAN
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Debug.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Tarzip.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Version.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Mirrors.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Distribution.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Distroprefs.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Author.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Index.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Complete.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Module.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/FirstTime.pm
t/logs/rtc-126010/smokecurrent.log view on Meta::CPAN
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Distrostatus.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/LWP/UserAgent.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/HTTP/Client.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/HTTP/Credentials.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Plugin/Specfile.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Kwalify/distroprefs.dd
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Kwalify/distroprefs.yml
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/FTP/netrc.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/API/HOWTO.pod
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Exception/blocked_urllist.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Exception/yaml_process_error.pm
[2018-08-13 08:08:21-0400] [manicheck] Matched cpan/CPAN/lib/CPAN/Exception/RecursiveDependency.pm
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
t/rfc9555.t view on Meta::CPAN
# RFC 9555 Figure 18: LANG
test_vcard('LANG',
"LANG;TYPE=work;PREF=1:en\nLANG;TYPE=work;PREF=2:fr\nLANG;TYPE=home:fr\n", sub {
ok($_[0]->{preferredLanguages}, 'has preferredLanguages');
my @langs = sort { ($a->{pref}//99) <=> ($b->{pref}//99) } values %{$_[0]->{preferredLanguages}};
is(scalar @langs, 3, 'three language prefs');
is($langs[0]{language}, 'en', 'first lang');
is($langs[0]{pref}, 1, 'pref=1');
ok($langs[0]{contexts}{work}, 'work context');
});
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Text/SpamAssassin.pm view on Meta::CPAN
use Text::SpamAssassin;
my $sa = Text::SpamAssassin->new(
sa_options => {
userprefs_filename => 'comment_spam_prefs.cf',
},
);
$sa->set_text($content);
lib/Text/SpamAssassin.pm view on Meta::CPAN
=head1 CONSTRUCTOR
my $sa = Text::SpamAssassin->new(
sa_options => {
userprefs_filename => 'comment_spam_prefs.cf',
},
);
As well as initializing the object the constructor creates a Mail::SpamAssassin object for the actual analysis work. The following options may be passed to the constructor
=over 4
=item sa_options
A hashref. This will be passed as-is to the Mail::SpamAssassin constructor. At the very least you probably want to provide the C<userprefs_filename> as the default configuration isn't particularly well suited to non-mail spam. See L<SPAMASSASSIN CONF...
=item lazy
By default the Mail::SpamAssassin object will be fully created in the Text::SpamAssassin constructor. This requires it to compile the rulesets and load any modules it needs which can take a little while. If the C<lazy> option is set to a true value, ...
lib/Text/SpamAssassin.pm view on Meta::CPAN
=head1 SPAMASSASSIN CONFIGURATION
By default SpamAssassin is configured in a way that does a good job of detecting spam in email traffic. Many of its rules that work well in that context are unsuitable for use in other scenarios. An example of this is DUN/DUL rulesets that check for ...
For this reason, its highly recommended that you specify an alternate configuration using the C<userprefs_filename> option in C<sa_options>. Sample configuration files can be found in the C<examples> directory of the C<Text-SpamAssassin> distribution...
=head1 BUGS
None known. Please report bugs via the CPAN Request Tracker at L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-SpamAssassin>
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Text/vCard.pm view on Meta::CPAN
}
return undef unless scalar(@to_return);
# Make prefered value first
@to_return = sort { _sort_prefs($b) <=> _sort_prefs($a) } @to_return;
return wantarray ? @to_return : \@to_return;
} else {
lib/Text/vCard.pm view on Meta::CPAN
push @lines, map { $_->as_string() } @$nodes;
}
return join $newline, @lines, $end, '';
}
sub _sort_prefs {
my $check = shift;
if ( $check->is_type('pref') ) {
return 1;
} else {
return 0;
view all matches for this distribution
view release on metacpan or search on metacpan
ApplicationNest.pm view on Meta::CPAN
# ------------------------------------------
my ($obj, $args) = @_;
$obj->{app} = delete $args->{'-app'} || 'Program';
$obj->{cfg} = delete $args->{'-cfg'} || sprintf( '%s/.%s.cfg', ($ENV{HOME} ? $ENV{HOME} : $ENV{HOMEDRIVE}.$ENV{HOMEPATH}), $obj->{app} );
$obj->{add_prefs} = delete $args->{'-add_prefs'};
$obj->{about} = delete $args->{'-about'};
$obj->{help} = delete $args->{'-help'} || $0;
$obj->SUPER::Populate($args);
$obj->ConfigSpecs(
-set_logo => ["METHOD", "set_logo", "Set_Logo", undef],
-set_icon => ["METHOD", "set_icon", "Set_Icon", undef],
-init_menu => ["METHOD", "init_menu", "Init_Menu", undef],
-init_prefs => ["METHOD", "init_prefs", "Init_Prefs", undef],
-init_main => ["METHOD", "init_main", "Init_Main", undef],
-init_status => ["METHOD", "init_status", "Init_Status", undef],
-add_status => ["METHOD", "add_status", "Add_Status", undef],
-add_toolbar => ["METHOD", "add_toolbar", "Add_Toolbar", undef],
-config => ["METHOD", "config", "Config", undef],
-skin => ["METHOD", "skin", "Skin", undef],
-prefs => ["METHOD", "prefs", "Prefs", undef],
-splash => ["METHOD", "splash", "Splash", undef],
-exit => ["METHOD", "exit", "Exit", undef],
-exit_cb => ["CALLBACK", "exit_cb", "Exit_Cb", undef],
);
ApplicationNest.pm view on Meta::CPAN
$obj->Advertise('menu' => $obj->{menu});
$obj->Advertise('main' => $obj->{main});
$obj->Advertise('status' => $obj->{status});
$obj->init_prefs();
$obj->update;
}
# ------------------------------------------
sub exit {
# ------------------------------------------
my $obj = shift || return error('No Object');
$obj->Callback(-exit_cb);
$obj->save_prefs;
exit;
}
# ------------------------------------------
sub set_icon {
ApplicationNest.pm view on Meta::CPAN
}
}
# ------------------------------------------
sub prefs {
# ------------------------------------------
my $obj = shift || return error('No Object');
return error('Please call Tk::ApplicationNest::init_prefs before call prefs')
unless defined $obj->{optobj};
my $w = $obj->{optobj}->option_editor(
$obj,
-buttons => [qw/ok save cancel defaults/],
-delaypagecreate => 0,
ApplicationNest.pm view on Meta::CPAN
}
$obj->Advertise('status_'.$name => $w);
}
# ------------------------------------------
sub init_prefs {
# ------------------------------------------
my $obj = shift || return error('No Object');
return $obj->{optobj} if defined $obj->{optobj};
my $optionen = shift || $obj->get_prefs($obj->{add_prefs});
my %opts;
$obj->{opt} = \%opts;
$obj->{optobj} = Tk::Getopt->new(
-opttable => $optionen,
ApplicationNest.pm view on Meta::CPAN
$obj->{optobj}->process_options;
return $obj->{opt};
}
# ------------------------------------------
sub save_prefs {
# ------------------------------------------
my $obj = shift || return error('No Object');
return $obj->{optobj}->save_options()
if defined $obj->{optobj};
}
# ------------------------------------------
sub get_prefs {
# ------------------------------------------
my $obj = shift || return error('No Object');
my $to_add = shift || [];
if(! ref $to_add and -e $to_add) {
ApplicationNest.pm view on Meta::CPAN
my $obj = shift || return error('No Object');
return $obj->{menu} if defined $obj->{menu};
my $menuitems = shift || [
[Cascade => "File", -menuitems =>
[
[Button => "Prefs", -command => sub{ $obj->prefs() } ],
[Button => "Quit", -command => sub{ $obj->exit }],
]
],
ApplicationNest.pm view on Meta::CPAN
-cfg => './testconfig.cfg',
-set_icon => './icon.gif',
-set_logo => './logo.gif',
-about => \$about,
-help => '../Tk/Program.pm',
-add_prefs => [
'Tools',
['acrobat', '=s', '/usr/local/bin/acroread',
{ 'subtype' => 'file',
'help' => 'Path to acrobat reader.'
} ],
ApplicationNest.pm view on Meta::CPAN
MainLoop;
=head1 DESCRIPTION
This is a megawidget to display a program window. I was tired of creating
menues, prefs dialogues, about dialogues,... for every new application..... I
searched for a generic way wrote this module. This modules stores the main
window's font, size and position and embodies the fucntions from the
Tk::Mainwindow module.
ApplicationNest.pm view on Meta::CPAN
Set the path to the config file, default:
$HOME/.$Application_Name.cfg
=head2 -add_prefs => $arrey_ref_more_prefs or $path_to_cfg_file;
This allows to include your Preferences into default:
-add_prefs => [
'Tools',
['acrobat', '=s', '/usr/local/bin/acroread',
{ 'subtype' => 'file',
'help' => 'Path to acrobat reader.'
} ],
],
Also you can use a config file as parameter:
-add_prefs => $path_to_cfg_file;
=head2 -set_logo => $image_file;
One logo for one program This picture will be use from the Splash and About
Method.
ApplicationNest.pm view on Meta::CPAN
=head1 METHODS
These are the methods you can use with this Widget.
=head2 $top->init_prefs( I<$prefs> );
This will initialize the user or default preferences. It returns a
reference to the options hash. More information about the prefsobject look at
B<Tk::Getopt> from
slaven. The Program which uses this Module has a configuration dialog in tk
and on the commandline with the following standard options:
=over 4
ApplicationNest.pm view on Meta::CPAN
In the Standard menu you find the preferences dialog under I<File - Prefs>.
I.E.:
my $opt = $top->init_prefs();
print $opt->{Geometry};
....
=head2 $top->prefs();
Display the Configuration dialog.
=head2 $top->set_icon( I<$path_to_icon> );
view all matches for this distribution
view release on metacpan or search on metacpan
Preferences.pm view on Meta::CPAN
###################################################
## (Tk::Preferences) Preferences.pm
## Andrew N. Hicox <andrew@hicox.com>
## http://www.hicox.com
##
## a module for applying a set of font/color prefs
## to all children of a perl/Tk widget.
###################################################
## Global Stuff ###################################
Preferences.pm view on Meta::CPAN
## SetPrefs #######################################
sub SetPrefs {
my ($parent, %p) = @_;
#required options
exists($p{'-prefs'}) || do {
$errstr = "-prefs is a required option to SetPrefs";
warn ($errstr) if $p{'-debug'};
return (undef);
};
#set the palette if defined
if (exists($p{'-prefs'}->{'Palette'})){
warn ("setting palette: $p{'-prefs'}->{'Palette'}") if $p{'-debug'};
$parent->setPalette($p{'-prefs'}->{'Palette'});
}
#set prefs in all child widgets
$parent->Walk(
sub { $_[0]->Tk::Preferences::ApplyWidget(\%p); }
);
#'tis all good
return (1);
Preferences.pm view on Meta::CPAN
## ApplyWidget ####################################
sub ApplyWidget {
my ($widget, $p) = @_;
my ($class,$type) = split (/::/,ref($widget));
#if it's a user defined meta type ...
foreach (keys %{$p->{'-prefs'}}){ if ($widget->{$_}){ $type = $_; last; } }
#if there's a user defined callback for this type do that instead of configure
if ((exists($p->{"-$type"})) && (ref($p->{"-$type"}) eq "CODE")){
warn ("executing callback for $type") if $p->{'-debug'};
&{$p->{"-$type"}}( @_ );
}else{
#configure widget with given -prefs
warn ("configuring $type") if $p->{'-debug'};
$widget->configure(%{$p->{'-prefs'}->{$type}}) if exists($p->{'-prefs'}->{$type});
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
# ------------------------------------------
my ($obj, $args) = @_;
$obj->{app} = delete $args->{'-app'} || 'Program';
$obj->{cfg} = delete $args->{'-cfg'} || sprintf( '%s/.%s.cfg', ($ENV{HOME} ? $ENV{HOME} : $ENV{HOMEDRIVE}.$ENV{HOMEPATH}), $obj->{app} );
$obj->{add_prefs} = delete $args->{'-add_prefs'};
$obj->{about} = delete $args->{'-about'};
$obj->{help} = delete $args->{'-help'} || $0;
$obj->SUPER::Populate($args);
$obj->ConfigSpecs(
-set_logo => ["METHOD", "set_logo", "Set_Logo", undef],
-set_icon => ["METHOD", "set_icon", "Set_Icon", undef],
-init_menu => ["METHOD", "init_menu", "Init_Menu", undef],
-init_prefs => ["METHOD", "init_prefs", "Init_Prefs", undef],
-init_main => ["METHOD", "init_main", "Init_Main", undef],
-init_status => ["METHOD", "init_status", "Init_Status", undef],
-add_status => ["METHOD", "add_status", "Add_Status", undef],
-add_toolbar => ["METHOD", "add_toolbar", "Add_Toolbar", undef],
-config => ["METHOD", "config", "Config", undef],
-skin => ["METHOD", "skin", "Skin", undef],
-prefs => ["METHOD", "prefs", "Prefs", undef],
-splash => ["METHOD", "splash", "Splash", undef],
-exit => ["METHOD", "exit", "Exit", undef],
-exit_cb => ["CALLBACK", "exit_cb", "Exit_Cb", undef],
);
$obj->Advertise('menu' => $obj->{menu});
$obj->Advertise('main' => $obj->{main});
$obj->Advertise('status' => $obj->{status});
$obj->init_prefs();
$obj->update;
}
# ------------------------------------------
sub exit {
}
}
# ------------------------------------------
sub prefs {
# ------------------------------------------
my $obj = shift || return error('No Object');
return error('Please call Tk::Program::init_prefs before call prefs')
unless defined $obj->{optobj};
my $w = $obj->{optobj}->option_editor(
$obj,
-buttons => [qw/ok save cancel defaults/],
-delaypagecreate => 0,
}
$obj->Advertise('status_'.$name => $w);
}
# ------------------------------------------
sub init_prefs {
# ------------------------------------------
my $obj = shift || return error('No Object');
return $obj->{optobj} if defined $obj->{optobj};
my $optionen = shift || $obj->get_prefs($obj->{add_prefs});
my %opts;
$obj->{opt} = \%opts;
$obj->{optobj} = Tk::Getopt->new(
-opttable => $optionen,
$obj->{optobj}->process_options;
return $obj->{opt};
}
# ------------------------------------------
sub get_prefs {
# ------------------------------------------
my $obj = shift || return error('No Object');
my $to_add = shift || [];
if(! ref $to_add and -e $to_add) {
my $obj = shift || return error('No Object');
return $obj->{menu} if defined $obj->{menu};
my $menuitems = shift || [
[Cascade => "File", -menuitems =>
[
[Button => "Prefs", -command => sub{ $obj->prefs() } ],
[Button => "Quit", -command => sub{ $obj->exit }],
]
],
-cfg => './testconfig.cfg',
-set_icon => './icon.gif',
-set_logo => './logo.gif',
-about => \$about,
-help => '../Tk/Program.pm',
-add_prefs => [
'Tools',
['acrobat', '=s', '/usr/local/bin/acroread',
{ 'subtype' => 'file',
'help' => 'Path to acrobat reader.'
} ],
MainLoop;
=head1 DESCRIPTION
This is a megawidget to display a program window. I was tired of creating
menues, prefs dialogues, about dialogues,... for every new application..... I
searched for a generic way wrote this module. This modules stores the main
window's font, size and position and embodies the fucntions from the
Tk::Mainwindow module.
Set the path to the config file, default:
$HOME/.$Application_Name.cfg
=head2 -add_prefs => $arrey_ref_more_prefs or $path_to_cfg_file;
This allows to include your Preferences into default:
-add_prefs => [
'Tools',
['acrobat', '=s', '/usr/local/bin/acroread',
{ 'subtype' => 'file',
'help' => 'Path to acrobat reader.'
} ],
],
Also you can use a config file as parameter:
-add_prefs => $path_to_cfg_file;
=head2 -set_logo => $image_file;
One logo for one program This picture will be use from the Splash and About
Method.
=head1 METHODS
These are the methods you can use with this Widget.
=head2 $top->init_prefs( I<$prefs> );
This will initialize the user or default preferences. It returns a
reference to the options hash. More information about the prefsobject look at
B<Tk::Getopt> from
slaven. The Program which uses this Module has a configuration dialog in tk
and on the commandline with the following standard options:
=over 4
In the Standard menu you find the preferences dialog under I<File - Prefs>.
I.E.:
my $opt = $top->init_prefs();
print $opt->{Geometry};
....
=head2 $top->prefs();
Display the Configuration dialog.
=head2 $top->set_icon( I<$path_to_icon> );
view all matches for this distribution
view release on metacpan or search on metacpan
eg/woodlice.pl view on Meta::CPAN
fill =>
[
[ '#7DDE4D', '#7DDE4D' ],
[ '#7DDE4D', '#7DDE4D' ],
],
prefs => [ 1, 1 ],
},
dry =>
{
fill =>
[
[ '#C1B24E', '#C1B24E' ],
[ '#7695EF', '#7695EF' ],
],
prefs => [ 1, 7 ],
},
light =>
{
fill =>
[
[ 'white', 'gray' ],
[ 'white', 'gray' ],
],
prefs => [ 1000, 1 ],
},
both =>
{
fill =>
[
[ '#F6D388', '#705824' ],
[ '#B7C8DB', '#215187' ],
],
prefs => [ 1000, 7 ],
}
);
################################# defaults #####################################
eg/woodlice.pl view on Meta::CPAN
);
my $taxis = $taxis_frame->Taxis
(
-width => $horiz,
-height => $vert,
-preference => $mode{$mode}{prefs},
-fill => $mode{$mode}{fill},
-population => $population,
-images => $critters,
-speed => $speed,
)
eg/woodlice.pl view on Meta::CPAN
$population = $population_scale->get();
$taxis->configure( -population => $population );
if ( $light && $dry )
{
$taxis->configure( -fill => $mode{both}{fill} );
$taxis->configure( -preference => $mode{both}{prefs} );
}
elsif ( $dry )
{
$taxis->configure( -fill => $mode{dry}{fill} );
$taxis->configure( -preference => $mode{dry}{prefs} );
}
elsif ( $light )
{
$taxis->configure( -fill => $mode{light}{fill} );
$taxis->configure( -preference => $mode{light}{prefs} );
}
else
{
$taxis->configure( -fill => $mode{none}{fill} );
$taxis->configure( -preference => $mode{none}{prefs} );
}
$option_box->destroy();
$taxis->refresh();
$supress_refresh = 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
pod/pTk/GetBitmap.pod view on Meta::CPAN
A cd disk icon.
=item B<preferences>
A folder with prefs symbol.
=item B<querydoc>
A database document icon.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Repository.pm view on Meta::CPAN
if ($query_repo =~ m!Default Remote: (http://.+)!) {
return $1;
}
}
open my $handle, '<', '_darcs/prefs/repos' or return;
while (<$handle>) {
chomp;
return $_ if m!^http://!;
}
} elsif (-e ".hg") {
view all matches for this distribution