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

Wow, wx.Yield/YieldIfNeeded is dangerous. Was causing recursive loop

involving gl.resources.get, due to ImageTexture calling
status.update (which was calling yield, and triggering another call to
resources.get). Things might be slightly unstable, as I'm playing around
with putting long running tasks on separate threads.
parent 937f2602
No related branches found
No related tags found
No related merge requests found
......@@ -135,7 +135,8 @@ class FSLEyesFrame(wx.Frame):
# Re-direct status updates to the status bar
def update(msg):
self.__statusBar.SetLabel(msg)
wx.YieldIfNeeded()
self.__statusBar.Refresh()
self.__statusBar.Update()
status.setTarget(update)
# Keeping track of all open view panels
......
......@@ -72,4 +72,5 @@ class FSLEyesSplash(wx.Frame):
def SetStatus(self, text):
"""Sets the text shown on the status bar to the specified ``text``. """
self.__statusBar.SetLabel(text)
wx.YieldIfNeeded()
self.__statusBar.Refresh()
self.__statusBar.Update()
......@@ -75,7 +75,6 @@ def context(args):
- the :class:`.FSLEyesSplash` frame
"""
import wx
import fsl.fsleyes.splash as fslsplash
# Create a splash screen, and use it
......@@ -90,8 +89,8 @@ def context(args):
frame.CentreOnScreen()
frame.Show()
frame.Refresh()
frame.Update()
wx.YieldIfNeeded()
import props
import fsl.fsleyes.gl as fslgl
......@@ -172,6 +171,8 @@ def interface(parent, args, ctx):
# behaviour is to restore the previous frame layout
if args.scene is None: restore = True
else: restore = False
status.update('Creating FSLeyes interface ...')
frame = fsleyesframe.FSLEyesFrame(
parent, overlayList, displayCtx, restore)
......@@ -184,12 +185,12 @@ def interface(parent, args, ctx):
# Closing the splash screen immediately
# can cause a crash under linux/GTK, so
# we'll do it a bit later.
def closeSplash():
splashFrame.Close()
wx.CallLater(1, closeSplash)
wx.YieldIfNeeded()
# we'll hide it now, and destroy it later.
splashFrame.Hide()
splashFrame.Refresh()
splashFrame.Update()
wx.CallLater(250, splashFrame.Close)
# Otherwise, we add the scene
# specified by the user
......
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