X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be43cc441addda05d1590e0ce983a84d949376da..cd72551c2b6cbf67a4a5caf0ba00ba64e41183b2:/wxPython/src/_extras.py?ds=sidebyside diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 2c27bf0584..6f61d91b81 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -62,6 +62,12 @@ def EVT_KEY_DOWN(win, func): 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) @@ -775,19 +781,20 @@ class wxPyWidgetTester(wxApp): # 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 #----------------------------------------------------------------------------