SWIGged updates for wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1565,6 +1565,29 @@ def wxPyTypeCast(obj, typeStr):
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
_wxCallAfterId = None
|
||||
|
||||
def wxCallAfter(callable, *args, **kw):
|
||||
"""
|
||||
Call the specified function after the current and pending event
|
||||
handlers have been completed.
|
||||
"""
|
||||
app = wxGetApp()
|
||||
assert app, 'No wxApp created yet'
|
||||
|
||||
global _wxCallAfterId
|
||||
if _wxCallAfterId is None:
|
||||
_wxCallAfterId = wxNewId()
|
||||
app.Connect(-1, -1, _wxCallAfterId,
|
||||
lambda event: apply(event.callable, event.args, event.kw) )
|
||||
evt = wxPyEvent()
|
||||
evt.SetEventType(_wxCallAfterId)
|
||||
evt.callable = callable
|
||||
evt.args = args
|
||||
evt.kw = kw
|
||||
wxPostEvent(app, evt)
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
class wxPyDeadObjectError(AttributeError):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user