Issue w/ wxPython 2.8.8.1 Mac menus and WindowDisabler/BusyInfo

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

Sorry to bump this up, but I'm completely befuddled by this. If no
one has any advice on how to avoid this problem, can anyone point me
in the direction of how to at least work around it?

Meaning, is there a way to forcibly re-enable disabled menus in wxMac?
I've tried recreating and setting the menu bar again (looping through
all windows), but that doesn't seem to work.

Thanks,
Jeff

···

On Tue, Mar 10, 2009 at 11:43 AM, Jeff Fein-Worton <jeff.fw@gmail.com> wrote:

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

Jeff Fein-Worton wrote:

Sorry to bump this up, but I'm completely befuddled by this. If no
one has any advice on how to avoid this problem, can anyone point me
in the direction of how to at least work around it?

Meaning, is there a way to forcibly re-enable disabled menus in wxMac?
I've tried recreating and setting the menu bar again (looping through
all windows), but that doesn't seem to work.

http://wiki.wxpython.org/MakingSampleApps

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!