Hi,
I have two widgets on a frame, one a single line textctrl and one a listbox.
When I generate an Enter Key event on the textctrl I am able to display a busy
cursor no problem, but when I generate the select event on the listbox the
busy cursor never changes. I have tried setting the cursor manually and using
wxYield() as well but it hasn't helped.
Does anyone know what the difference in the events could be that won't allow
the cursor to change?
-Mike
from wxPython.wx import *
import time
class TimmyDialog(wxFrame):
def __init__(self):
wxFrame.__init__(self, NULL, -1, 'Test', wxDefaultPosition,
wxSize(250, 200))
self.namesearchtxt = wxTextCtrl(self, -1, '', (10, 10),
(200, 20), style=wxTE_PROCESS_ENTER)
self.namelist = wxListBox(self, -1, (10, 50), (200, 100),
['1', '2'], style=wxLB_SINGLE)
#events
EVT_TEXT_ENTER(self, self.namesearchtxt.GetId(), self.OnSearch)
EVT_LISTBOX(self, self.namelist.GetId(), self.OnSelect)
def OnSearch(self, event):
print 'Enter!'
wxBusyCursor() # This works!
time.sleep(5)
def OnSelect(self, event):
print 'Select!'
wxBusyCursor() # This doesn't!
time.sleep(5)
class TheApp(wxApp):
def OnInit(self):
mainwin = TimmyDialog()
mainwin.Show(true)
self.SetTopWindow(mainwin)
return true
app = TheApp(0)
app.MainLoop()
···
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users