]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/_extras.py
Fixed bug in DnD. wxDragSource will now delete itself when done.
[wxWidgets.git] / utils / wxPython / src / _extras.py
index 564f3aa353eeb15255a13155be059e6f18592ec1..cdff6809b30ff810c7a7a18817c6f447a3017b08 100644 (file)
@@ -472,6 +472,15 @@ def EVT_TREE_KEY_DOWN(win, id, func):
 def EVT_TREE_DELETE_ITEM(win, id, func):
     win.Connect(id, -1, wxEVT_COMMAND_TREE_DELETE_ITEM, func)
 
 def EVT_TREE_DELETE_ITEM(win, id, func):
     win.Connect(id, -1, wxEVT_COMMAND_TREE_DELETE_ITEM, func)
 
+def EVT_TREE_ITEM_ACTIVATED(win, id, func):
+    win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_ACTIVATED, func)
+
+def EVT_TREE_ITEM_RIGHT_CLICK(win, id, func):
+    win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, func)
+
+def EVT_TREE_ITEM_MIDDLE_CLICK(win, id, func):
+    win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, func)
+
 
 # wxSpinButton
 def EVT_SPIN_UP(win, id, func):
 
 # wxSpinButton
 def EVT_SPIN_UP(win, id, func):
@@ -772,7 +781,16 @@ class wxApp(wxPyApp):
 
 #----------------------------------------------------------------------------
 # DO NOT hold any other references to this object.  This is how we know when
 
 #----------------------------------------------------------------------------
 # DO NOT hold any other references to this object.  This is how we know when
-# to cleanup system resources that wxWin is holding...
+# to cleanup system resources that wxWin is holding.  When this module is
+# 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()
+
 __cleanMeUp = __wxPyCleanup()
 #----------------------------------------------------------------------------
 
 __cleanMeUp = __wxPyCleanup()
 #----------------------------------------------------------------------------