Spookymonster has asked for the wisdom of the Perl Monks concerning the following question:
If done right, I would expect the label to display 'var= 4' (as long as I don't override -target). Instead, I get an error message indicating I'm using an unreferenced variable. What am I doing wrong?package SR::Dtest; use strict; use warnings; use Tk; use Tk::widgets; use base qw(Tk::Frame); Construct Tk::Widget 'Dtest'; sub Populate { my($self, $args) = @_; $self->SUPER::Populate($args); $self->ConfigSpecs(-target => ['PASSIVE','target','Target',4]); my $optnum = $self->optionGet('Target','Dtest'); $self->Label(-text=>"var= $optnum")->grid(); $self->pack; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to access options to Tk widgets
by graff (Chancellor) on May 10, 2002 at 02:30 UTC | |
by Spookymonster (Initiate) on May 10, 2002 at 03:34 UTC | |
by Popcorn Dave (Abbot) on May 10, 2002 at 05:27 UTC | |
by Rich36 (Chaplain) on May 10, 2002 at 14:16 UTC | |
by Popcorn Dave (Abbot) on May 10, 2002 at 19:27 UTC | |
| |
|
Re: How to access options to Tk widgets
by Spookymonster (Initiate) on May 10, 2002 at 14:33 UTC | |
by Spookymonster (Initiate) on May 10, 2002 at 17:38 UTC |