Cancel the timer and show the main frame immediately if the
splashscreen window is closed early. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1679,16 +1679,27 @@ class MySplashScreen(wx.SplashScreen):
|
|||||||
wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
|
wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
|
||||||
5000, None, -1)
|
5000, None, -1)
|
||||||
self.Bind(wx.EVT_CLOSE, self.OnClose)
|
self.Bind(wx.EVT_CLOSE, self.OnClose)
|
||||||
wx.FutureCall(2000, self.ShowMain)
|
self.fc = wx.FutureCall(2000, self.ShowMain)
|
||||||
|
|
||||||
|
|
||||||
def OnClose(self, evt):
|
def OnClose(self, evt):
|
||||||
|
# Make sure the default handler runs too so this window gets
|
||||||
|
# destroyed
|
||||||
|
evt.Skip()
|
||||||
self.Hide()
|
self.Hide()
|
||||||
evt.Skip() # Make sure the default handler runs too...
|
|
||||||
|
# if the timer is still running then go ahead and show the
|
||||||
|
# main frame now
|
||||||
|
if self.fc.IsRunning():
|
||||||
|
self.fc.Stop()
|
||||||
|
self.ShowMain()
|
||||||
|
|
||||||
|
|
||||||
def ShowMain(self):
|
def ShowMain(self):
|
||||||
frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
|
frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
|
||||||
frame.Show()
|
frame.Show()
|
||||||
self.Raise()
|
if self.fc.IsRunning():
|
||||||
|
self.Raise()
|
||||||
|
|
||||||
|
|
||||||
class MyApp(wx.App):
|
class MyApp(wx.App):
|
||||||
|
Reference in New Issue
Block a user