Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: TK: button update

by mawe (Hermit)
on Sep 11, 2004 at 18:39 UTC ( [id://390298]=note: print w/replies, xml ) Need Help??


in reply to TK: button update

Hi!

You could do it like this:

use Tk; my $FILTER_IS_ON = 0; my $top = new MainWindow(); my $b = $top->Button(-text=>$FILTER_IS_ON ? 'turn off' : 'turn on', -command => \&turn)->pack(); MainLoop(); sub turn { $FILTER_IS_ON = $FILTER_IS_ON ? 0 : 1; $b->configure(-text=> $FILTER_IS_ON ? 'turn off' : 'turn on'); }
mawe

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://390298]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found