in reply to tk widget options stored in hash
G'day glenn,
Predefining default options is a good idea. Your problem here is that your using a hashref instead of a hash: you want %{$colors{lbl}}, not $colors{lbl}.
Also, if you put your defaults first, you can override them if you want to. E.g.
$frame->LabEntry( %{$colors{lbl}}, -other_opt => 'other_value', -background => 'non_default_colour' );
By the way, your "PS: i have also tried: ..." is wrong for all sorts of reasons. Use strict and warnings in all your scripts to pick up errors like this:
$ perl -Mstrict -Mwarnings -e ' my %colours = ( lbl => { "-background => tan, -foreground => black +", } ); ' Odd number of elements in anonymous hash at -e line 2.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: tk widget options stored in hash
by glenn (Scribe) on Nov 13, 2013 at 20:01 UTC | |
|
Re^2: tk widget options stored in hash
by glenn (Scribe) on Nov 13, 2013 at 21:20 UTC | |
by kcott (Archbishop) on Nov 13, 2013 at 22:24 UTC |