[Tutor] using wxSPlashScreen?

I had been referred to lib/splashscreen class in response to a previous
question on creation of splash screen.The documentation states that the
class has been deprecated.I am trying to use wxSPlashScreen class to
create a splash Screen.

Here is what I have come up with so far.

Help me out with understanding the inheritance in python
by this practical example.

#import all modules from wxPython
from wxPython.wx import *

#define a class SplashScreen that inherits wxSplashScreen
class SplashScreen(wxSplashScreen):
# Default = defined default value for the given variable
  def __init__(self,bitmapfile,splashStyle,milliseconds,parent,id,
                pos = Default,size = Default,style = Default):
            #I am calling the __init__ method of wxSplashScreen as the-
            #constructor is not inherited automatically
            # Although wxWindows defines the constructor as receiving
            #a wxBitMap object as first argument Can we use a
            # bit map file string?

            wxSplashScreen.__init_(self,bitMapPath,
                                   wxSPLASH_CENTER_ON_SCREEN,6000,None,-1)

class splashApp(wxApp):
  def OnInit(self):
    wxInitAllImageHandlers()
    #make an instance of SplashScreen)
    splash = SplashScreen("file.bmp",wxSPLASH_CENTER_ON_SCREEN_,6000,None,-1)
    splash.Show(true)
    splash.SetTopWindow(splash)
    return true

def main():
appinstance = splashApp(0)
appinstance.MainLoop()

if__name__ == '__main__'
  main()

My questions?
while running in debug mode, it says wxSPLASH_CENTER_ON_SCREEN is not
defined?
but it is a valid argument in wxWindows
How do I set up a bit map into the splash screen
Does any one have an example of using the wxSplashScreen class;
not the one in lib/splashscreen which apparently is deprecated.

Some of these might be basic but I am new to python and have programming
experience in c (only a quarter worth)
Thanks
satyam

···

_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Hi Chekuri,

chekuri@uchicago.edu wrote:

I had been referred to lib/splashscreen class in response to a previous question on creation of splash screen.The documentation states that the
class has been deprecated.I am trying to use wxSPlashScreen class to create a splash Screen.

Here is what I have come up with so far.

Help me out with understanding the inheritance in python
by this practical example.

#import all modules from wxPython
from wxPython.wx import *

#define a class SplashScreen that inherits wxSplashScreen
class SplashScreen(wxSplashScreen):
# Default = defined default value for the given variable
def __init__(self,bitmapfile,splashStyle,milliseconds,parent,id,
               pos = Default,size = Default,style = Default):
           #I am calling the __init__ method of wxSplashScreen as the-
           #constructor is not inherited automatically
           # Although wxWindows defines the constructor as receiving #a wxBitMap object as first argument Can we use a
           # bit map file string?

           wxSplashScreen.__init_(self,bitMapPath,
                                  wxSPLASH_CENTER_ON_SCREEN,6000,None,-1)

class splashApp(wxApp):
def OnInit(self):
   wxInitAllImageHandlers()
   #make an instance of SplashScreen)
   splash = SplashScreen("file.bmp",wxSPLASH_CENTER_ON_SCREEN_,6000,None,-1)
   splash.Show(true)
   splash.SetTopWindow(splash)
   return true

def main():
appinstance = splashApp(0)
appinstance.MainLoop()

if__name__ == '__main__'
main()

My questions?
while running in debug mode, it says wxSPLASH_CENTER_ON_SCREEN is not
defined?
but it is a valid argument in wxWindows
How do I set up a bit map into the splash screen
Does any one have an example of using the wxSplashScreen class;
not the one in lib/splashscreen which apparently is deprecated.

class MySplashScreen(wxSplashScreen):
    def __init__(self):
        bmp = wxImage(opj("images/twcbSplash.gif")).ConvertToBitmap()
        wxSplashScreen.__init__(self, bmp,
                                wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
                                100000, None, -1,
                                style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP)

in your wxAPP class do at least the two last lines, I don't show the Splash when running in development mode as you can see anything with its STAY_ON_TOP style.

        if self.showSplash == True:
            self.splash = MySplashScreen()
            self.splash.Show()

Hope this helps.

See you
Werner

···

Some of these might be basic but I am new to python and have programming
experience in c (only a quarter worth)
Thanks
satyam

_______________________________________________
Tutor maillist - Tutor@python.org
Tutor Info Page

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org