MCPcopy Create free account
hub / github.com/ipython/ipython / inputhook_wx1

Function inputhook_wx1

IPython/terminal/pt_inputhooks/wx.py:28–47  ·  view source on GitHub ↗

Run the wx event loop by processing pending events only. This approach seems to work, but its performance is not great as it relies on having PyOS_InputHook called regularly.

(context)

Source from the content-addressed store, hash-verified

26
27@ignore_keyboardinterrupts
28def inputhook_wx1(context):
29 """Run the wx event loop by processing pending events only.
30
31 This approach seems to work, but its performance is not great as it
32 relies on having PyOS_InputHook called regularly.
33 """
34 app = wx.GetApp()
35 if app is not None:
36 assert wx.Thread_IsMain()
37
38 # Make a temporary event loop and process system events until
39 # there are no more waiting, then allow idle events (which
40 # will also deal with pending or posted wx events.)
41 evtloop = wx.EventLoop()
42 ea = wx.EventLoopActivator(evtloop)
43 while evtloop.Pending():
44 evtloop.Dispatch()
45 app.ProcessIdle()
46 del ea
47 return 0
48
49
50class EventLoopTimer(wx.Timer):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected