Hi,
I'm trying to Enable/Disable a MenuItem (depending on application state), however I keep getting a 'core dump'.
The following example produces the same result.
Any hints.
Nikolai
PS: Use Python 2.0, wxPython 2.2.1 / wxPython 2.2.2
···
********************************
#
from wxPython.wx import *
class MyParentFrame(wxMDIParentFrame):
def __init__(self):
wxMDIParentFrame.__init__(self, None, -1, "Test", size=(600,400))
menu = wxMenu()
submenu = wxMenu()
self.menuitem = wxMenuItem(NULL, 5001, "Child1")
submenu.AppendItem(self.menuitem)
menu.AppendMenu(5002, "Super", submenu)
menu.AppendSeparator()
menu.Append(5003, "E&xit")
menubar = wxMenuBar()
menubar.Append(menu, "&File")
self.SetMenuBar(menubar)
#------------
class MyApp(wxApp):
def OnInit(self):
self.frame = MyParentFrame()
self.frame.Show(true)
self.SetTopWindow(self.frame)
return true
app = MyApp(0)
app.frame.menuitem.Enable(0)
app.MainLoop()
********************************
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users