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 bstrd import bsstream
|
||||
|
||||
from panel import MainPanel
|
||||
|
||||
|
||||
def run(*args, **kwargs):
|
||||
app = wx.App()
|
||||
wx.Yield = app.Yield
|
||||
frame = MainFrame(*args, **kwargs)
|
||||
frame.Show()
|
||||
app.MainLoop()
|
||||
@ -43,8 +46,11 @@ class MainFrame(wx.Frame):
|
||||
|
||||
|
||||
def on_close(self, event):
|
||||
print("bye")
|
||||
bsstream.stop()
|
||||
self.persist.save()
|
||||
event.Skip() # forward the close event
|
||||
wx.GetApp().Yield()
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user