G'day all,
I have a simple wxTextCtrl in a wxFrame that has a popup menu when you right
click on it.
It uses EVT_UPDATE_UI to enable/disable menu items on this menu.
How do I get rid of the memory leak messages for this menu. If I attach them
to a
menubar they are cleaned up properly, but I really don't want them on a
menubar.
I also have noticed something really weird in this simple application when I
add the
EVT_UPDATE_UI section I get the following error message under windows
(under GTK it works fine)
Fatal Python error: PyThreadState_Get: no current thread
abnormal program termination
There are no threading functions or methods used anywhere.
the relevant code snipet is here.....
self.menu = wxMenu()
reuseID = wxNewId()
self.menu.Append( reuseID, "Start Logging to file..." ,"Begin logging to a
file" )
# if I uncomment the next line the abnormal program termination occurs.
#EVT_UPDATE_UI( self, reuseID, self.isLogging)
EVT_MENU( self, reuseID, self.startLogging )
reuseID = wxNewId()
self.menu.Append( reuseID, "Stop Logging to file" ,"Stop logging to a
file" )
EVT_UPDATE_UI( self, reuseID, self.isNotLogging)
EVT_MENU( self, reuseID, self.stopLogging )
reuseID = wxNewId()
self.menu.Append( reuseID, "Dump to file", "Saves the text windows
contents to a file" )
EVT_MENU( self, reuseID, self.saveToFile )
EVT_RIGHT_DOWN( self, self.onRightClick )
try:
self.GetParent().GetParent().GetMenuBar().Append(self.menu,"Logging")
except:
pass
def isLogging( self, event):
if LOGFILE == 0: event.Enable(1); return
event.Enable(0)
return
def isNotLogging( self, event):
if LOGFILE == 0: event.Enable(0); return
event.Enable(1)
return
···
---------------
Thanks in advance for any help.
---Gareth Walters