Hello. I've created the class below to use when calling a remote
method (using Twisted,) which sets the busy cursor, disables all the
windows, and displays a "busy" message. That (mostly) works--for some
reason, on Windows, the windows don't actually *look* disabled, and
moving the mouse cursor after it changes to busy changes it back to
the regular cursor. But that's not actually what I'm concerned with
at the moment.
The problem that I'm having that's kind of a show-stopper and
extremely confusing is that on Mac, on some windows using this class,
after the remote method returns, and Done() is called, the cursor
returns to normal, and the windows all re-enable--except for the
menus. The menus either appear grayed out, or actually show the menu
for a *different* window within the same app. The really strange
thing is that if I comment out the WindowDisabler lines, it fixes the
problem for some times that I'm using the class, but not all, and if I
comment out the BusyInfo stuff, *that* fixes the problem for the
*other* times, but not all of them.
As far as I can tell, the menus work fine in Windows and Linux.
class BusyWait:
def __init__(self, func, *args, **kwargs):
busy_message = kwargs.pop('busy_message', None)
self.wd = wx.WindowDisabler()
if busy_message:
self.bi = wx.BusyInfo(busy_message)
func(*args, **kwargs).addCallback(self.Done)
wx.BeginBusyCursor()
def Done(self, *args, **kwargs):
wx.EndBusyCursor()
try:
del self.bi
except AttributeError:
pass
del self.wd
Anyone have any idea where to even start looking for a solution to
this? I'd really like to keep this feature, as some searches/actions
can take a few seconds to complete. I can give more details in to the
Twisted implementation, if you think it's necessary (I'm using
wxreactor from there, which I fear may be the culprit.)
Thanks,
Jeff