[wxPython-users] Checkable items in popup menus

Suzuki Alex Alex.Suzuki at ksta.ktzh.ch
Wed Nov 29 05:42:47 PST 2006


> I am popping up a wx.Menu containing checkable items (added by calling
> AppendCheckItem) using wx.Window.PopupMenu(). I create the menu once
> and popup the same instance later. My problem is that checkable items
> are not automatically checked/unchecked when I click them.
> 
> I tried adding a checkable item to the menu bar of my application, and
> there it works fine.

I would like to add that manually checking and unchecking them by doing
something like this works fine. 

        item = menu.AppendCheckItem(wx.NewId(), "Emailbenachrichtigung")
        self.Bind(wx.EVT_MENU, self.OnLdapSendmailClick, item)
        item.Check()
        self.menuItemLdapSendmail = item


    def OnLdapSendmailClick(self, event):
        self.menuItemLdapSendmail.Check(not self.menuItemLdapSendmail.IsChecked())


If someone knows how to prevent a popup menu from "popping down" :-) when clicking
a menu item (especially checkable ones), any hints would be much appreciated.

cheers, Alex




More information about the wxpython-users mailing list