make sure start and stop behave nicely
This commit is contained in:
6
start.py
6
start.py
@ -5,11 +5,14 @@ import wx
|
|||||||
|
|
||||||
from slic.gui.persist import Persistence
|
from slic.gui.persist import Persistence
|
||||||
|
|
||||||
|
from bstrd import bsstream
|
||||||
|
|
||||||
from panel import MainPanel
|
from panel import MainPanel
|
||||||
|
|
||||||
|
|
||||||
def run(*args, **kwargs):
|
def run(*args, **kwargs):
|
||||||
app = wx.App()
|
app = wx.App()
|
||||||
|
wx.Yield = app.Yield
|
||||||
frame = MainFrame(*args, **kwargs)
|
frame = MainFrame(*args, **kwargs)
|
||||||
frame.Show()
|
frame.Show()
|
||||||
app.MainLoop()
|
app.MainLoop()
|
||||||
@ -43,8 +46,11 @@ class MainFrame(wx.Frame):
|
|||||||
|
|
||||||
|
|
||||||
def on_close(self, event):
|
def on_close(self, event):
|
||||||
|
print("bye")
|
||||||
|
bsstream.stop()
|
||||||
self.persist.save()
|
self.persist.save()
|
||||||
event.Skip() # forward the close event
|
event.Skip() # forward the close event
|
||||||
|
wx.GetApp().Yield()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user