Fixed problem between the splash screen and tip dialog.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -132,6 +132,7 @@ class wxPythonDemo(wxFrame):
|
|||||||
|
|
||||||
|
|
||||||
self.otherWin = None
|
self.otherWin = None
|
||||||
|
self.showTip = true
|
||||||
EVT_IDLE(self, self.OnIdle)
|
EVT_IDLE(self, self.OnIdle)
|
||||||
EVT_CLOSE(self, self.OnCloseWindow)
|
EVT_CLOSE(self, self.OnCloseWindow)
|
||||||
EVT_ICONIZE(self, self.OnIconfiy)
|
EVT_ICONIZE(self, self.OnIconfiy)
|
||||||
@@ -413,6 +414,25 @@ class wxPythonDemo(wxFrame):
|
|||||||
self.window = self.otherWin
|
self.window = self.otherWin
|
||||||
self.otherWin = None
|
self.otherWin = None
|
||||||
|
|
||||||
|
if self.showTip:
|
||||||
|
self.ShowTip()
|
||||||
|
self.showTip = false
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def ShowTip(self):
|
||||||
|
try:
|
||||||
|
showTipText = open(opj("data/showTips")).read()
|
||||||
|
showTip, index = eval(showTipText)
|
||||||
|
except IOError:
|
||||||
|
showTip, index = (1, 0)
|
||||||
|
if showTip:
|
||||||
|
tp = wxCreateFileTipProvider(opj("data/tips.txt"), index)
|
||||||
|
showTip = wxShowTip(self, tp)
|
||||||
|
index = tp.GetCurrentTip()
|
||||||
|
open(opj("data/showTips"), "w").write(str( (showTip, index) ))
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------
|
#---------------------------------------------
|
||||||
def OnDemoMenu(self, event):
|
def OnDemoMenu(self, event):
|
||||||
try:
|
try:
|
||||||
@@ -480,21 +500,7 @@ class MySplashScreen(wxSplashScreen):
|
|||||||
def OnClose(self, evt):
|
def OnClose(self, evt):
|
||||||
frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
|
frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
|
||||||
frame.Show(true)
|
frame.Show(true)
|
||||||
self.ShowTip(frame)
|
evt.Skip() # Make sure the default handler runs too...
|
||||||
self.Destroy()
|
|
||||||
|
|
||||||
def ShowTip(self, frame):
|
|
||||||
try:
|
|
||||||
showTipText = open(opj("data/showTips")).read()
|
|
||||||
showTip, index = eval(showTipText)
|
|
||||||
except IOError:
|
|
||||||
showTip, index = (1, 0)
|
|
||||||
if showTip:
|
|
||||||
tp = wxCreateFileTipProvider(opj("data/tips.txt"), index)
|
|
||||||
showTip = wxShowTip(frame, tp)
|
|
||||||
index = tp.GetCurrentTip()
|
|
||||||
open(opj("data/showTips"), "w").write(str( (showTip, index) ))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MyApp(wxApp):
|
class MyApp(wxApp):
|
||||||
@@ -506,7 +512,6 @@ class MyApp(wxApp):
|
|||||||
wxInitAllImageHandlers()
|
wxInitAllImageHandlers()
|
||||||
splash = MySplashScreen()
|
splash = MySplashScreen()
|
||||||
splash.Show()
|
splash.Show()
|
||||||
wxYield()
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user