"be consistent" | |
PerlMonks |
Re: Perl/TK: how to set defaults for the whole script?by kcott (Archbishop) |
on Oct 24, 2012 at 08:24 UTC ( [id://1000570]=note: print w/replies, xml ) | Need Help?? |
G'day perltux, You can put all your default options in a hash.
An alternative to this is to use an option database. You can set this up external to your script (e.g. with a .Xdefaults file) allowing access by multiple scripts; you can also use optionAdd(), and related methods, to handle options within a single script. See option for details. Here's an example of usage extracted from one of my own scripts. configure_option_database() is called after MainWindow->new() but before any widgets are created.
-- Ken
In Section
Seekers of Perl Wisdom
|
|