Changing button preferences after beeing pressed

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Thu Aug 16 05:23:22 EDT 2007


 thomas.lidebrandt at gmail.com wrote:
> I'm using wxPython to consruct a GUI and want to change a button
> label 

=> wx.Button.SetLabel (also have a look at the button examples)

> and event handler to change after the button have been 
> pressed. 

I'm not sure if those bindings can easily be changed at runtime.
Another solution is creating two buttons and only show one at a
time.

> The only thing I can think of is a global variable that 
> contrls the state of the program and constructs the button in
> accordance to the defined state. 

Better keep the state as frame attribute and use a frame method to
change it.

Regards,


Björn

-- 
BOFH excuse #61:

not approved by the FCC




More information about the Python-list mailing list