[wxPython-dev] Problem with MenuItem.Destroy()

Paul McNett p at ulmcnett.com
Fri Dec 22 09:09:12 PST 2006


Robin Dunn wrote:
> Sorry, I thought I had dealt with this bug already but the fix isn't in 
> the code currently so maybe it accidentally got reverted or something.

Okay, I just found another problem, reproducible with the Menu.py example:

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

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


====
We already know that the commented item.Destroy() segfaults in wx2.8.0.1 
but not in wx 2.6. What we know now is that while the RemoveItem() works 
fine in both, the AppendItem() does not (segfault in 2.8).

The good news is that I believe all the remaining issues in Dabo come 
down to this problem. We tend to move menu items around...

It is possible we are seeing similar trouble with removing/adding items 
to sizers, but I don't have proof of that yet.

Thanks
Paul


-- 
pkm ~ http://paulmcnett.com





More information about the wxpython-dev mailing list