]> git.saurik.com Git - wxWidgets.git/commitdiff
reSWIGged
authorRobin Dunn <robin@alldunn.com>
Sun, 21 Nov 2004 00:51:22 +0000 (00:51 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 21 Nov 2004 00:51:22 +0000 (00:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/mac/_core.py
wxPython/src/msw/_core.py

index 817f8533e0f97b7110b6f46c23655f9a351ea716..292e6c7ad9f7e59b07b450ffd7a6da8933487b19 100644 (file)
@@ -10814,7 +10814,6 @@ class _wxPyUnbornObject(object):
 
 
 #----------------------------------------------------------------------------
-_wxPyCallAfterId = None
 
 def CallAfter(callable, *args, **kw):
     """
@@ -10828,19 +10827,17 @@ def CallAfter(callable, *args, **kw):
     app = wx.GetApp()
     assert app is not None, 'No wx.App created yet'
 
-    global _wxPyCallAfterId
-    if _wxPyCallAfterId is None:
-        _wxPyCallAfterId = wx.NewEventType()
-        app.Connect(-1, -1, _wxPyCallAfterId,
-              lambda event: event.callable(*event.args, **event.kw) )
+    if not hasattr(app, "_CallAfterId"):
+        app._CallAfterId = wx.NewEventType()
+        app.Connect(-1, -1, app._CallAfterId,
+                    lambda event: event.callable(*event.args, **event.kw) )
     evt = wx.PyEvent()
-    evt.SetEventType(_wxPyCallAfterId)
+    evt.SetEventType(app._CallAfterId)
     evt.callable = callable
     evt.args = args
     evt.kw = kw
     wx.PostEvent(app, evt)
 
-
 #----------------------------------------------------------------------------
 
 
index 621941d2838fec0114d007d527b17fb944683e5a..6fbf7ccaffaabce9ac64e5e4ad5eef3d6d20656e 100644 (file)
@@ -10883,7 +10883,6 @@ class _wxPyUnbornObject(object):
 
 
 #----------------------------------------------------------------------------
-_wxPyCallAfterId = None
 
 def CallAfter(callable, *args, **kw):
     """
@@ -10897,19 +10896,17 @@ def CallAfter(callable, *args, **kw):
     app = wx.GetApp()
     assert app is not None, 'No wx.App created yet'
 
-    global _wxPyCallAfterId
-    if _wxPyCallAfterId is None:
-        _wxPyCallAfterId = wx.NewEventType()
-        app.Connect(-1, -1, _wxPyCallAfterId,
-              lambda event: event.callable(*event.args, **event.kw) )
+    if not hasattr(app, "_CallAfterId"):
+        app._CallAfterId = wx.NewEventType()
+        app.Connect(-1, -1, app._CallAfterId,
+                    lambda event: event.callable(*event.args, **event.kw) )
     evt = wx.PyEvent()
-    evt.SetEventType(_wxPyCallAfterId)
+    evt.SetEventType(app._CallAfterId)
     evt.callable = callable
     evt.args = args
     evt.kw = kw
     wx.PostEvent(app, evt)
 
-
 #----------------------------------------------------------------------------