I have a wxSpinCtrl with some default value set. I want to have that value
selected whenever ctrl gains focus, either by using TAB or by clicking with
the mouse. How can I connect EVT_SET_FOCUS(func) with my control?
I'm used to EVT_SOME_EVENT(Id, func) to connect the specific event to the
control with id Id, but I don't know how to use, say, EVT_SET_FOCUS in
MyFrame.__init__() where I have all of my event handlers.
Looking at this, I'm probably doing something wrong:
I have
class ExtractFrame(wxFrame):
def __init__(self, parent, id, title,
pos = wxPyDefaultPosition, size = wxPyDefaultSize,
style = wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCAPTION ):
wxFrame.__init__(self, parent, id, title, pos, size, style)
...
self.panel = wxPanel(self, -1, pos, size, style)
self.mainDialog = MainDialog(self.panel)
...
# WDR: handler declarations for ExtractFrame
EVT_MENU(self, ID_ABOUT, self.OnAbout)
...
EVT_BUTTON(self, ID_INPUT_BROWSE_BUTTON, self.ShowInputDirDialog)
...
EVT_CHECKBOX(self, ID_SAME_OUTPUT_CHECKBOX, self.SameOutputCheckBox)
I can easily fetch my spin control, but where I should EVT_SET_FOCUS? Is
that the right event handler?
Thanks!
···
--
davor.cengija@mail.inet.hr