X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be43cc441addda05d1590e0ce983a84d949376da..935b53f2fb175499ac1a8ed53ccd2b986dcdd43a:/wxPython/src/_extras.py diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 2c27bf0584..708d1fd586 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) @@ -545,19 +551,6 @@ def EVT_TOGGLEBUTTON(win, id, func): -# Help events -def EVT_HELP(win, id, func): - win.Connect(id, -1, wxEVT_HELP, func) - -def EVT_HELP_RANGE(win, id, id2, func): - win.Connect(id, id2, wxEVT_HELP, func) - -def EVT_DETAILED_HELP(win, id, func): - win.Connect(id, -1, wxEVT_DETAILED_HELP, func) - -def EVT_DETAILED_HELP_RANGE(win, id, id2, func): - win.Connect(id, id2, wxEVT_DETAILED_HELP, func) - def EVT_CONTEXT_MENU(win, func): win.Connect(-1, -1, wxEVT_CONTEXT_MENU, func) @@ -775,19 +768,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 #----------------------------------------------------------------------------