Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Dynamically altering Tk buttons

by Llew_Llaw_Gyffes (Scribe)
on Jan 04, 2010 at 16:19 UTC ( [id://815595]=note: print w/replies, xml ) Need Help??


in reply to Re: Dynamically altering Tk buttons
in thread Dynamically altering Tk buttons

This doesn't really answer the question.  This illustrates a checkbutton which has different bitmaps for its selected and unselected states.  A checkbutton, however, has persistent state.  What I need to do is have a regular pushbutton which changes its button bitmap, in a persistent fashion, both in response to UI actions and to remote commands not involving the UI, and which may have more than two visual states.

I've subsequently discovered that there is, indeed, a simple way to do this; but the documentation of the method is somewhat obscurely buried in Tk::options.  That method is as simple as this:

$button->configure(-bitmap => 'MyNewBitmap');

Using this method, I now have multimode buttons that change their button image and foreground color as appropriate depending on what the application is doing, exactly as I wanted.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2024-04-19 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found