WxButton

M.E.Farmer mefjr75 at hotmail.com
Sun Dec 26 04:09:09 EST 2004


ok this is slightly confusing , so I am just gonna throw out some ides.
You could  define an accelerator table and just bind wxACCEL_NORMAL,
and WXK_RETURN to an id number.
then set  an event handler to operate your button(more on that later).
Or you can set an event to just look for a certain key :
Declare this event.

py> EVT_KEY_DOWN(self, self.OnKeyPressed)

And do something like this.

py> def OnKeyPressed(self, event):
...        key = event.KeyCode()
...        if key == WXK_RETURN:
...            BtnPressCode()

Ok now the button thing what are you wanting just to activate the
button or to toggle the button or.?
There are many buttons types and they have very different methods!
I will leave that code up to you ( just do a google search for wxButton
or wxToggleButton or even wxBitmapButton and many more just search the
docs they are very helpful, and always this is covered somewhere in the
wx demo ;)
Hth, 
M.E.Farmer




More information about the Python-list mailing list