Thanks Robin,
The version is wxPython-2.8.12.0-1.el6.x86_64.
I made a static text only for four characters “test” to the program, see following test program, if you comment out line 15 you can see busy cursor. I actually tested on another machine CentOS 5.5 32-bit, it came the same results.
#!/usr/bin/python
import wx
class MyForm(wx.Frame):
def init(self):
wx.Frame.init(self, None, wx.ID_ANY, “Test”)
self.panel = wx.Panel(self, wx.ID_ANY)
b1 = wx.Button(self.panel, label=“Busy”)
b1.Bind(wx.EVT_BUTTON, self.changeCursorBusy)
b2 = wx.Button(self.panel, label=“Idle”)
b2.Bind(wx.EVT_BUTTON, self.changeCursorIdle)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(wx.StaticText(self.panel, label =“test”))
sizer.Add(b1)
sizer.Add(b2)
self.panel.SetSizer(sizer)
self.busy = False
def changeCursorBusy(self, event):
self.ChangeStatus(True)
def changeCursorIdle(self, event):
self.ChangeStatus(False)
def ChangeStatus(self, busy):
if busy:
cursor= wx.StockCursor(wx.CURSOR_WAIT)
else:
cursor= wx.StockCursor(wx.CURSOR_ARROW)
self.panel.SetCursor(cursor)
if name == “main”:
app = wx.PySimpleApp()
frame = MyForm().Show()
app.MainLoop()
···
On Thursday, December 13, 2012 10:22:59 AM UTC+11, Robin Dunn wrote:
On 12/12/12 1:42 AM, nobody wrote:
Hi,
I am running wxPython on CentOS 6, and I could not explain following an
issue:
In my program, I called wx.StockCursor(wx.CURSOR_ARROWWAIT) when
a button was clicked and it was busy loading. It worked fine until I
added a wx.StaticText object, the cursor spinning stopped. Unless I am
missing something here, I reckon it could be a bug. I don’t think
wx.GridBagSizer could be the problem which is what I used. Could anyone
enlighten me what is going on? Appreciate if you could also let me know
how to fix it.
wxPython version?
Does the static text widget cover the whole frame? Is the static text
added in response to the button click or does it exist prior to that? A
simple sample would be nice. http://wiki.wxpython.org/MakingSampleApps
–
Robin Dunn
Software Craftsman
http://wxPython.org