glenn has asked for the wisdom of the Perl Monks concerning the following question:
How to get TK widget option to accept variable reference? I need to use this in more than one place and it's not an option to store the button in the hashref as this hashref will be updated by other clients.
use Tk; $mw = MainWindow->new(); my $system = {}; $system->{blink}->[0] = "disabled"; #works but does not update as value in hashref changes my $but = $mw->Button(-text=>"Blink Unit", -state=>$system->{blink}->[ +0])->pack(); #does not work as state will not accept variable reference #my $but = $mw->Button(-text=>"Blink Unit", -state=>\$system->{blink}- +>[0])->pack(); =pod *$but->{'Configure'}->{'-state'} = \$system->{blink}->[0]; #overwrite +the location of the value?? =cut
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk Button state tied to variable
by choroba (Cardinal) on Oct 22, 2014 at 22:40 UTC | |
Re: Tk Button state tied to variable ( Tk::Trace )
by Anonymous Monk on Oct 22, 2014 at 22:19 UTC | |
by glenn (Scribe) on Oct 23, 2014 at 13:33 UTC | |
Re: Tk Button state tied to variable
by GotToBTru (Prior) on Oct 22, 2014 at 21:41 UTC | |
by glenn (Scribe) on Oct 22, 2014 at 22:00 UTC | |
Re: Tk Button state tied to variable
by glenn (Scribe) on Oct 23, 2014 at 03:39 UTC |
Back to
Seekers of Perl Wisdom