MDI Application with wxPython and Splash Screen

130 views
Skip to first unread message

Jorge Carretero Gulias

unread,
Aug 8, 2016, 2:16:01 PM8/8/16
to wxPython-users
Hi everyone.-

I am trying to create a MDI application and i have succeded but the problem is that i want to add a Splash Screen and both things i cant mix, can anybody help me with this please?

Igor Korot

unread,
Aug 8, 2016, 2:28:37 PM8/8/16
to wxpytho...@googlegroups.com
Hi
What kind of problem do you have?
Can you show some code?
Can you create just a splash screen?

Thank you.

>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to wxpython-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jorge Carretero Gulias

unread,
Aug 8, 2016, 2:38:53 PM8/8/16
to wxPython-users

Hi im new to wx.python, well almoust new to everything mi code is this

##
## DO NOT EDIT
##
#----------------------------------------------------------------------#
# This is a minimal wxPython program to show a SplashScreen widget.
#
# Tian Xie
# 3/8/2005
#----------------------------------------------------------------------#

import wx

class MDIFrame(wx.MDIParentFrame): 
   def __init__(self): 
      wx.MDIParentFrame.__init__(self, None, -1, "MDI Parent", size = (600,400)) 
      menu = wx.Menu() 
      menu.Append(5000, "&New Window") 
      menu.Append(5001, "&Exit") 
      menubar = wx.MenuBar() 
      menubar.Append(menu, "&File") 
        
      self.SetMenuBar(menubar) 
      self.Bind(wx.EVT_MENU, self.OnNewWindow, id = 5000) 
      self.Bind(wx.EVT_MENU, self.OnExit, id = 5001) 
     
        
   def OnExit(self, evt): 
      self.Close(True)  

"def __init__(self, parent, id, title):"
"wx.Frame.__init__(self, parent, id, title)"


class MyGUI(wx.MDIParentFrame):
    """
Hello World!
    """
    def __init__(self, parent, id, title):
        ThexType=wx.MDIParentFrame.__init__(self, parent, id, title)       
        
# Put more GUI code here for a fancier application.
#----------------------------------------------------------------------#

class MySplashScreen(wx.SplashScreen):
    """
Create a splash screen widget.
    """
    def __init__(self, parent=None):
        # This is a recipe to a the screen.
        # Modify the following variables as necessary.
        aBitmap = wx.Image(name = "nvidia.jpg").ConvertToBitmap()
        splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT
        splashDuration = 1000 # milliseconds
        # Call the constructor with the above arguments in exactly the
        # following order.
        wx.SplashScreen.__init__(self, aBitmap, splashStyle,
                                 splashDuration, parent)
        self.Bind(wx.EVT_CLOSE, self.OnExit)
        wx.Yield()
        
#----------------------------------------------------------------------#

    def OnExit(self, evt):
        self.Hide()
    
        MyFrame = MyGUI(None, -1, XType)
        app.SetTopWindow(MyFrame)
        MyFrame.Show(True)
           
        evt.Skip()  # Make sure the default handler runs too...
#----------------------------------------------------------------------#
   
class MyApp(wx.App):
    def OnInit(self):
        "frame = MDIFrame()"
        "frame.Show()"
        "win = wx.MDIChildFrame(self, -1, Child Window)"
        "win.Show(True)" 
        MySplash = MySplashScreen()
        MySplash.Show()

        return True
#----------------------------------------------------------------------#

app = MyApp(redirect=True, filename = "demo.log")
app.MainLoop()

Thank you very much and great forum 

Jorge Carretero Gulias

unread,
Aug 8, 2016, 2:42:47 PM8/8/16
to wxPython-users
if i use a normal Frame it works but i want a MDI Form

Jorge Carretero Gulias

unread,
Aug 8, 2016, 2:55:13 PM8/8/16
to wxPython-users
Oh sorry heres the image of the splash
nvidia.jpg
Reply all
Reply to author
Forward
0 new messages