[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r6120 - trunk/gnue-forms/src/uidrivers/wx
From: |
jcater |
Subject: |
r6120 - trunk/gnue-forms/src/uidrivers/wx |
Date: |
Mon, 2 Aug 2004 20:26:49 -0500 (CDT) |
Author: jcater
Date: 2004-08-02 20:26:48 -0500 (Mon, 02 Aug 2004)
New Revision: 6120
Modified:
trunk/gnue-forms/src/uidrivers/wx/UIWXSplashScreen.py
Log:
fixed the splashscreen to work with wx 2.5.x
Modified: trunk/gnue-forms/src/uidrivers/wx/UIWXSplashScreen.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx/UIWXSplashScreen.py 2004-08-02
08:48:32 UTC (rev 6119)
+++ trunk/gnue-forms/src/uidrivers/wx/UIWXSplashScreen.py 2004-08-03
01:26:48 UTC (rev 6120)
@@ -29,7 +29,13 @@
import os.path
from wxPython.wx import *
-from wxPython.lib.splashscreen import SplashScreen
+try:
+ from wx import SplashScreen
+ newsplash = True
+except ImportError:
+ from wxPython.lib.splashscreen import SplashScreen
+ newsplash = False
+
from gnue.common.apps import GConfig
from gnue.forms import VERSION
@@ -40,11 +46,19 @@
bitmapFile=gConfigForms('splashScreenPNG')
else:
bitmapFile=images_dir+gConfigForms('splashScreenPNG')
-
- SplashScreen.__init__(self,None,bitmapfile=bitmapFile,
- duration = 3000, callback=self.onCloseSplash,
-
style=wxCENTRE_ON_SCREEN|wxSIMPLE_BORDER|wxSTAY_ON_TOP
- ) # TODO: A 2.4 thing? ->
wxSPLASH_TIMEOUT|wxFRAME_NO_TASKBAR)
+
+ if newsplash:
+ img = wxEmptyImage()
+ img.LoadFile(bitmapFile)
+ SplashScreen.__init__(self,wxBitmapFromImage(img),
+ wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
+ 2000, None, -1)
+ EVT_CLOSE(self, self.onCloseSplash)
+ else:
+ SplashScreen.__init__(self,None,bitmapfile=bitmapFile,
+ duration = 3000, callback=self.onCloseSplash,
+
style=wxCENTRE_ON_SCREEN|wxSIMPLE_BORDER|wxSTAY_ON_TOP)
+
swidth,sheight = self.GetSizeTuple()
# Make the splash text print white
@@ -63,7 +77,7 @@
wxStaticText(parent=self, id=-1, label=str(text),
size=wxSize(swidth,theight),
pos=wxPoint(1,25),style=wxALIGN_CENTRE)
- text = "(c)2000-2002 Free Software Foundation"
+ text = "(c)2000-2004 Free Software Foundation"
twidth,theight = self.GetTextExtent(text)
wxStaticText(self, -1, str(text),
wxPoint(1,50),wxSize(swidth,theight),wxALIGN_CENTRE)
@@ -92,12 +106,11 @@
# can :P The fix works for me all the way down to a
# splash duration=1 millisecond
#
- def onCloseSplash(self):
+ def onCloseSplash(self, event=None):
#self._wxapp.SetTopWindow(self.mainWindow) #TODO: May need to put back
but doubt it
#self.mainWindow.Show(true) #TODO: May need to put back
but doubt it
wxYield() # Flush the pending queue to insure something is
# there before the splashscreen dies
-
# For some reason, a simple Close() doesn't cooperate with
# the modal login box and all hell breaks loose
self.Show(0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r6120 - trunk/gnue-forms/src/uidrivers/wx,
jcater <=