Is the wx event loop running.
(app=None)
| 77 | return app |
| 78 | |
| 79 | def is_event_loop_running_wx(app=None): |
| 80 | """Is the wx event loop running.""" |
| 81 | # New way: check attribute on shell instance |
| 82 | ip = get_ipython() |
| 83 | if ip is not None: |
| 84 | if ip.active_eventloop and ip.active_eventloop == 'wx': |
| 85 | return True |
| 86 | # Fall through to checking the application, because Wx has a native way |
| 87 | # to check if the event loop is running, unlike Qt. |
| 88 | |
| 89 | # Old way: check Wx application |
| 90 | if app is None: |
| 91 | app = get_app_wx() |
| 92 | if hasattr(app, '_in_event_loop'): |
| 93 | return app._in_event_loop |
| 94 | else: |
| 95 | return app.IsMainLoopRunning() |
| 96 | |
| 97 | def start_event_loop_wx(app=None): |
| 98 | """Start the wx event loop in a consistent manner.""" |
no test coverage detected