Author: bugman Date: Thu Feb 4 02:14:51 2010 New Revision: 10637 URL: http://svn.gna.org/viewcvs/relax?rev=10637&view=rev Log: Completely changed how the splash screen is displayed on program start up. A new wx.App class has been created for relax for showing the splash screen (through wx.SplashScreen) and then a delayed building and showing of the main GUI interface. Added: branches/bieri_gui/gui_bieri/images/start_no_alpha.png (with props) Modified: branches/bieri_gui/gui_bieri/__init__.py Modified: branches/bieri_gui/gui_bieri/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/__init__.py?rev=10637&r1=10636&r2=10637&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/__init__.py (original) +++ branches/bieri_gui/gui_bieri/__init__.py Thu Feb 4 02:14:51 2010 @@ -31,6 +31,7 @@ # Python module imports. import sys +from time import sleep if dep_check.wx_module: import wx @@ -38,6 +39,9 @@ from about import About_relax, MyFrame from relax_errors import RelaxError from relax_gui import Main + +# relax GUI module imports. +from paths import IMAGE_PATH __all__ = ['relax_gui'] @@ -56,22 +60,49 @@ sys.stdout.write('##############################################\n') sys.stdout.write('\n\n\n\n') - # start wx Application - relaxGUI = wx.PySimpleApp(0) - wx.InitAllImageHandlers() - - # show about panel - #about = About_relax(None, -1, "") - about = MyFrame(None, -1, "") - about.ShowModal() - # Dependency check. if not dep_check.wx_module: sys.stderr.write("Please install the wx Python module to access the Bieri GUI.\n\n") sys.exit() - # Build the GUI. - relaxGUI_main = Main(parent=None, id=-1, title="") - relaxGUI.SetTopWindow(relaxGUI_main) - relaxGUI_main.Show() - relaxGUI.MainLoop() + # Start the relax GUI wx application. + App() + + + +class App(wx.App): + """The relax GUI wx application.""" + + def OnInit(self): + """Build the application, showing a splash screen first.""" + + # Show the splash screen. + self.show_splash() + + # Build the GUI. + main = Main(parent=None, id=-1, title="") + + # Make it the main application component. + self.SetTopWindow(main) + + # Wait a little while :) + sleep(1) + + # Show it. + main.Show() + + # Start the GUI main loop execution. + self.MainLoop() + + + def show_splash(self): + """Build and show the splash screen.""" + + # The image. + bmp = wx.Bitmap(IMAGE_PATH+'start_no_alpha.png', wx.BITMAP_TYPE_ANY) + + # The timeout (ms). + timeout = 2500 + + # The splash screen. + screen = wx.SplashScreen(bmp, wx.SPLASH_NO_CENTER|wx.SPLASH_TIMEOUT, timeout, None, -1) Added: branches/bieri_gui/gui_bieri/images/start_no_alpha.png URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/images/start_no_alpha.png?rev=10637&view=auto ============================================================================== Binary file - no diff available. Propchange: branches/bieri_gui/gui_bieri/images/start_no_alpha.png ------------------------------------------------------------------------------ svn:mime-type = image/png