Problem with MenuItem.Destroy()

Paul McNett p at ulmcnett.com
Fri Dec 8 11:52:40 PST 2006


Sorry, I don't have time right now to build and test with the preview, 
but this happens in wxPython 2.7.2 at least.

Modify the example for Menu.py as follows:

--- Menu.py.orig        2006-12-08 11:49:41.000000000 -0800
+++ Menu.py     2006-12-08 11:48:39.000000000 -0800
@@ -81,6 +81,8 @@
          item = wx.MenuItem(menu5, 500, "&Smile!\tCtrl+S", "This one 
has an icon")
          item.SetBitmap(images.getSmilesBitmap())
          menu5.AppendItem(item)
+        menu5.RemoveItem(item)
+        item.Destroy()

          # Shortcuts
          menu5.Append(501, "Interesting thing\tCtrl+A", "Note the 
shortcut!")


The call to item.Destroy() causes a segfault. This wasn't the case in 
wx2.6.

-- 
pkm ~ http://paulmcnett.com





More information about the wxpython-dev mailing list