]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/wx.py
Fixed a bunch of leaking references in how the callbacks deal with
[wxWidgets.git] / wxPython / src / gtk / wx.py
index 4bcfb8da71f876bc46e90b29e694c4729d86d56b..8870c05092e2e19c89234f1a9352374978563250 100644 (file)
@@ -448,6 +448,13 @@ wxLI_HORIZONTAL = wxc.wxLI_HORIZONTAL
 wxLI_VERTICAL = wxc.wxLI_VERTICAL
 wxHW_SCROLLBAR_NEVER = wxc.wxHW_SCROLLBAR_NEVER
 wxHW_SCROLLBAR_AUTO = wxc.wxHW_SCROLLBAR_AUTO
+wxJOYSTICK1 = wxc.wxJOYSTICK1
+wxJOYSTICK2 = wxc.wxJOYSTICK2
+wxJOY_BUTTON1 = wxc.wxJOY_BUTTON1
+wxJOY_BUTTON2 = wxc.wxJOY_BUTTON2
+wxJOY_BUTTON3 = wxc.wxJOY_BUTTON3
+wxJOY_BUTTON4 = wxc.wxJOY_BUTTON4
+wxJOY_BUTTON_ANY = wxc.wxJOY_BUTTON_ANY
 wxDEFAULT = wxc.wxDEFAULT
 wxDECORATIVE = wxc.wxDECORATIVE
 wxROMAN = wxc.wxROMAN
@@ -1514,22 +1521,49 @@ def EVT_TIMER(win, id, func):
 def EVT_END_PROCESS(eh, id, func):
     eh.Connect(id, -1, wxEVT_END_PROCESS, func)
 
+
+# wxJoyStick
+def EVT_JOY_DOWN(win, func):
+    win.Connect(-1, -1, wxEVT_JOY_DOWN, func)
+
+def EVT_JOY_UP(win, func):
+    win.Connect(-1, -1, wxEVT_JOY_UP, func)
+
+def EVT_JOY_MOVE(win, func):
+    win.Connect(-1, -1, wxEVT_JOY_MOVE, func)
+
+def EVT_JOY_ZMOVE(win, func):
+    win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func)
+
+def EVT_JOYSTICK_EVENTS(win, func):
+    win.Connect(-1, -1, wxEVT_JOY_DOWN, func)
+    win.Connect(-1, -1, wxEVT_JOY_UP, func)
+    win.Connect(-1, -1, wxEVT_JOY_MOVE, func)
+    win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func)
+
 #----------------------------------------------------------------------
 
 class wxTimer(wxPyTimer):
-    def __init__(self):
-        wxPyTimer.__init__(self, self.Notify)   # derived class must provide
-                                                # Notify(self) method.
+    def __init__(self, evtHandler = None, id = -1):
+        if evtHandler is None:
+            wxPyTimer.__init__(self, self.Notify)   # derived class must provide
+                                                    # Notify(self) method.
+        else:
+            wxPyTimer.__init__(self, None)
+            self.SetOwner(evtHandler, id)
 
 #----------------------------------------------------------------------
 # Some wxWin methods can take "NULL" as parameters, but the shadow classes
 # expect an object with the SWIG pointer as a 'this' member.  This class
 # and instance fools the shadow into passing the NULL pointer.
 
-class NullObj:
+## NOTE:  This is not needed anymore as None can be passed instead and
+#         will be interpreted as NULL.
+
+class _NullObj:
     this = 'NULL'       # SWIG converts this to (void*)0
 
-NULL = NullObj()
+NULL = _NullObj()
 
 
 #----------------------------------------------------------------------