How to add keyboard event to a button in wxglade??
add keyboard event to button in wxglade
Collapse
X
-
Tags: None
-
Actually i want to perform the action of the button on my frame by pressing enter from the keyboard and not clicking the button using mouse..im using wxglade with python 2.4..Originally posted by bartoncMaybe you want to add a keyboard shortcut. Can you be more specific with your questions, please.
Thanks for joining the Python Forum on TheScripts.com.Comment
-
Originally posted by agsupriya86Actually i want to perform the action of the button on my frame by pressing enter from the keyboard and not clicking the button using mouse..im using wxglade with python 2.4..aught to do the trick (where 'thisButton' is the name of the button you want clicked what you hit the enter key).Code:thisButton.SetDefault()
Comment
-
Im not getting where to add this code..in _init_ or in _set_properties function or in the action perform of button??Originally posted by bartoncaught to do the trick (where 'thisButton' is the name of the button you want clicked what you hit the enter key).Code:thisButton.SetDefault()
Comment
-
I haven't use wxGlade in a long time. In Boa Constructor (or non-generated code), it goes in __init__().Originally posted by agsupriya86Im not getting where to add this code..in _init_ or in _set_properties function or in the action perform of button??Comment
-
not working in any of the three function:(Originally posted by bartoncI haven't use wxGlade in a long time. In Boa Constructor (or non-generated code), it goes in __init__().
its syntax goes like this..self.butt on_1.SetDefault ()Comment
-
Since you are using wxGlade, I'm wondering what version of wxPython you are using. The self.button_1.S etDefault() thing really should have worked.Originally posted by agsupriya86not working in any of the three function:(
its syntax goes like this..self.butt on_1.SetDefault ()Comment
-
im using python 2.4Originally posted by bartoncSince you are using wxGlade, I'm wondering what version of wxPython you are using. The self.button_1.S etDefault() thing really should have worked.Comment
Comment