]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/Main.py
Bug fixes, new tests and demos, new generated source...
[wxWidgets.git] / utils / wxPython / demo / Main.py
index 3b474d0b0994f4758b8b6afa8fa1564ba5bfc4cb..aa3d1776daf58d1b91864ba7fd055203924df105 100644 (file)
@@ -13,7 +13,7 @@
 
 import sys, os
 from   wxPython.wx import *
-
+from   wxPython.lib.splashscreen import SplashScreen
 
 #---------------------------------------------------------------------------
 
@@ -21,7 +21,8 @@ _useSplitter       = true
 _useNestedSplitter = true
 
 _treeList = [
-    ('New since last release', ['wxMVCTree', 'wxVTKRenderWindow']),
+    ('New since last release', ['wxMVCTree', 'wxVTKRenderWindow',
+                                'FileBrowseButton']),
 
     ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']),
 
@@ -49,7 +50,8 @@ _treeList = [
 
     ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',
                           'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar',
-                          'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow']),
+                          'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow',
+                          'FileBrowseButton',]),
 
     ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']),
 
@@ -61,6 +63,8 @@ class wxPythonDemo(wxFrame):
     def __init__(self, parent, id, title):
         wxFrame.__init__(self, parent, -1, title, size = (725, 550))
 
+        self.cwd = os.getcwd()
+
         if wxPlatform == '__WXMSW__':
             self.icon = wxIcon('bitmaps/mondrian.ico', wxBITMAP_TYPE_ICO)
             self.SetIcon(self.icon)
@@ -238,6 +242,7 @@ class wxPythonDemo(wxFrame):
 
     #---------------------------------------------
     def RunDemo(self, itemText):
+        os.chdir(self.cwd)
         if self.nb.GetPageCount() == 3:
             if self.nb.GetSelection() == 2:
                 self.nb.SetSelection(0)
@@ -355,7 +360,16 @@ class MyApp(wxApp):
         wxImage_AddHandler(wxJPEGHandler())
         wxImage_AddHandler(wxPNGHandler())
         wxImage_AddHandler(wxGIFHandler())
-        frame = wxPythonDemo(NULL, -1, "wxPython: (A Demonstration)")
+
+        self.splash = SplashScreen(None, bitmapfile='bitmaps/splash.gif',
+                              duration=4000, callback=self.AfterSplash)
+        self.splash.Show(true)
+        wxYield()
+        return true
+
+    def AfterSplash(self):
+        self.splash.Close(true)
+        frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
         frame.Show(true)
         self.SetTopWindow(frame)
         return true