Splash screen positioning

That totally worked, Roee. Thanks so much!

So now instead of defining self.frame, the code calls the init for wx.Frame. I am having a hard time getting my head around the essential difference, but that is just a result of me not understanding Python very well yet.

Thanks,
Sam

···

----- Original Message ----
From: roee shlomo roee88@gmail.com
To: wxPython-users@lists.wxwidgets.org
Sent: Monday, October 1, 2007 4:59:58 AM
Subject: Re: [wxPython-users] Splash screen positioning

I fixed your code:

import wx

class App(wx.App):
def OnInit(self):
frame = Frame()
frame.Show()
return True

class Frame(wx.Frame):
def init(self):

Set up the frame

   wx.Frame.__init__(self, None, id = -1, title = "Domainspotter!", pos = (300, 200), size = (700, 600))

Show logo splash screen while things startup

   splashimg = wx.Image("resources/logo.png", wx.BITMAP_TYPE_PNG).ConvertToBitmap()
    wx.SplashScreen(splashimg, wx.SPLASH_CENTRE_ON_PARENT

wx.SPLASH_TIMEOUT, 2000, self, -1)
wx.Yield()

a = App()
a.MainLoop()

  • Roee.

wormwood_3 wrote:

That totally worked, Roee. Thanks so much!

So now instead of defining self.frame, the code calls the init for wx.Frame. I am having a hard time getting my head around the essential difference, but that is just a result of me not understanding Python very well yet.

The __init__ methods don't return anything, they just initialize the self object. So you were still passing None to the SplashScreen for the parent parameter.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!