Skip to content
Snippets Groups Projects
Commit c1b79f4a authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Platform.haveGui checks that thw wx main loop is running.

parent 0610fbb4
No related branches found
No related tags found
No related merge requests found
......@@ -140,7 +140,11 @@ class Platform(notifier.Notifier):
"""``True`` if we are running with a GUI, ``False`` otherwise. """
try:
import wx
return self.canHaveGui and wx.GetApp() is not None
app = wx.GetApp()
return (self.canHaveGui and
app is not None and
app.IsMainLoopRunning())
except ImportError:
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment