def EVT_KEY_UP(win, func):
win.Connect(-1, -1, wxEVT_KEY_UP, func)
+def EVT_MENU_OPEN(win, func):
+ win.Connect(-1, -1, wxEVT_MENU_OPEN, func)
+
+def EVT_MENU_CLOSE(win, func):
+ win.Connect(-1, -1, wxEVT_MENU_CLOSE, func)
+
def EVT_MENU_HIGHLIGHT(win, id, func):
win.Connect(id, -1, wxEVT_MENU_HIGHLIGHT, func)
# unloaded, the refcount on __cleanMeUp goes to zero and it calls the
# wxApp_CleanUp function.
-## class __wxPyCleanup:
-## def __init__(self):
-## self.cleanup = wxc.wxApp_CleanUp
-## def __del__(self):
-## self.cleanup()
+class __wxPyCleanup:
+ def __init__(self):
+ self.cleanup = wxc.wxApp_CleanUp
+ def __del__(self):
+ self.cleanup()
-## __cleanMeUp = __wxPyCleanup()
+sys.__wxPythonCleanup = __wxPyCleanup()
-if sys.version[0] == '2':
- import atexit
- atexit.register(wxc.wxApp_CleanUp)
-else:
- sys.exitfunc = wxc.wxApp_CleanUp
+## # another possible solution, but it gets called too early...
+## if sys.version[0] == '2':
+## import atexit
+## atexit.register(wxc.wxApp_CleanUp)
+## else:
+## sys.exitfunc = wxc.wxApp_CleanUp
#----------------------------------------------------------------------------