[wxPython] menu issues

Hello, I have a trouble with menus now.
I have a menu that dynamically changes so I'd like to have a single handler
that gets called and is able to detect the menu entry that was selected.

The following code works under Linux

def OnMode(self, event):
     print self.mode_menu.GetLabel(event.GetInt())

but fails under Windows (in Windows event.GetInt() always returns 0, bug?
feature?).

Any solution/workaround is welcome.

Ciao,
    Davide.

Hello, I have a trouble with menus now.
I have a menu that dynamically changes so I'd like to have a single

handler

that gets called and is able to detect the menu entry that was selected.

The following code works under Linux

def OnMode(self, event):
     print self.mode_menu.GetLabel(event.GetInt())

but fails under Windows (in Windows event.GetInt() always returns 0, bug?
feature?).

Any solution/workaround is welcome.

You should use event.GetId() for menus. I think GetInt() is supposed to
signify if the menu item is checked. If wxGTK is returning the menu ID from
GetInt() then it is the one that is broken.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!