Hi, I've created a simple dialog, with a couple of
text controls and two buttons, a Cancel Button and an
OK button.
The problem I'm experiencing is that when you tab from
control to control, the system "skips" over the OK
button. In otherwords I can set the focus of the
individual controls via tab except for the OK button.
I've dug through mailing archives and googled
newsgroups to no avail. The code is as follows:
Any help would be appreciated!
class ChunkDialog(wxDialog) :
def __init__(self,parent=None) :
wxDialog.__init__(self, parent, -1, "New Chunk",
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER )
self.sizer = wxBoxSizer( wxVERTICAL )
self.entry = wxTextCtrl(self, -1,
style=wxTE_PROCESS_ENTER )
self.text = wxTextCtrl(self, -1,
style=wxTE_MULTILINE )
self.bOk = wxButton(self, wxID_OK, " &Ok ")
self.bOk.SetDefault()
self.bCancel = wxButton(self, wxID_CANCEL, " &Cancel
")
self.sizer.Add( self.entry,1, wxALL|wxEXPAND,10)
self.sizer.Add( self.text, 1, wxALL|wxEXPAND,10)
hor = wxBoxSizer( wxHORIZONTAL )
hor.Add( self.bOk, 0, wxALL,10 )
hor.Add( self.bCancel, 0, wxALL,10 )
self.sizer.Add( hor, 0, wxALIGN_CENTER)
self.SetSizer(self.sizer)
self.sizer.SetSizeHints( self )
# EVT_BUTTON( self, wxID_CANCEL, self.OnCancel)
# EVT_BUTTON( self, wxID_OK, self.OnOK)
def GetTag(self) : return self.entry.GetValue()
def GetText(self) : return self.text.GetValue()
def OnOK(self,event) :
self.EndModal(COMPLETED)
def OnCancel(self,event) :
self.EndModal(CANCELED)
···
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree