Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3231930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:06:08+00:00 2026-05-17T17:06:08+00:00

Currently I have a splash screen in place. However, it does not work as

  • 0

Currently I have a splash screen in place. However, it does not work as a real splash screen – as it halts the execution of the rest of the code (instead of allowing them to run in the background).

This is the current (reduced) arquitecture of my program, with the important bits displayed in full. How can I adapt the splash screen currently in place to actually allow the rest of the program to load in the background? Is it possible in python?

Thanks!

import ...
(many other imports)
def ...
def ...
(many other definitions)

class VFrams(wxFrame):
    wx.Frame.__init__(self, parent, -1, _("Software"), 
                      size=(1024, 768), style=wx.DEFAULT_FRAME_STYLE)
    (a lot of code goes in here)

class MySplashScreen(wx.SplashScreen):
    def __init__(self, parent=None):
        aBitmap = wx.Image(name=VarFiles["img_splash"]).ConvertToBitmap()
        splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT
        splashDuration = 5000 # ms
        wx.SplashScreen.__init__(self, aBitmap, splashStyle, splashDuration, parent)
        self.Bind(wx.EVT_CLOSE, self.CloseSplash)
        wx.Yield()
    def CloseSplash(self, evt):
        self.Hide()
        global frame
        frame = VFrame(parent=None)
        app.SetTopWindow(frame)
        frame.Show(True)
        evt.Skip()

class MyApp(wx.App):
    def OnInit(self):
        MySplash = MySplashScreen()
        MySplash.Show()
        return True

if __name__ == '__main__':
    DEBUG = viz.addText('DEBUG:', viz.SCREEN)
    DEBUG.setPosition(0, 0)
    DEBUG.fontSize(16)
    DEBUG.color(viz.BLACK)
    Start_Mainvars()        
    Start_Config()
    Start_Translation()
    Start_DB()
    Start_Themes()
    Start_Gui()
    Start_Get_Isos()
    Start_Bars()
    Start_Menus()
    Start_Event_Handlers()
    app = MyApp()
    app.MainLoop()

Thank you for all the help, this is how I changed the code (following the provided advice):

def show_splash():
    # create, show and return the splash screen
    global splash
    bitmap = wx.Image(name=VarFiles["img_splash"]).ConvertToBitmap()
    splash = wx.SplashScreen(bitmap, wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_NO_TIMEOUT, 0, None, -1)
    splash.Show()
    return splash

class MyApp(wx.App):
    def OnInit(self):
        global frame, splash
        splash = show_splash()
        Start_Config()
        Start_Translation()
        Start_DB()
        Start_Themes()
        Start_Gui()
        Start_Get_Isos()
        Start_Bars("GDP1POP1_20091224_gdp", "1 pork")
        Start_Menus()
        Start_Event_Handlers()
        frame = VFrame(parent=None)
        frame.Show(True)
        splash.Destroy()
        return True

if __name__ == '__main__':
    DEBUG = viz.addText('DEBUG:', viz.SCREEN)
    DEBUG.setPosition(0, 0)
    DEBUG.fontSize(16)
    DEBUG.color(viz.BLACK)
    Start_Mainvars()   
    app = MyApp()
    app.MainLoop()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:06:09+00:00Added an answer on May 17, 2026 at 5:06 pm

    Your code is pretty messy/complicated. There’s no need to override wx.SplashScreen and no reason your splash screen close event should be creating the main application window. Here’s how I do splash screens.

    import wx
    
    def show_splash():
        # create, show and return the splash screen
        bitmap = wx.Bitmap('images/splash.png')
        splash = wx.SplashScreen(bitmap, wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_NO_TIMEOUT, 0, None, -1)
        splash.Show()
        return splash
    
    def main():
        app = wx.PySimpleApp()
        splash = show_splash()
    
        # do processing/initialization here and create main window
        frame = MyFrame(...)
        frame.Show()
    
        splash.Destroy()
        app.MainLoop()
    
    if __name__ == '__main__':
        main()
    

    Just create the splash screen as soon as possible with no timeout. Continue loading and create your application’s main window. Then destroy the splash screen so it goes away. Showing the splash screen doesn’t stop other processing from happening.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I everyone. I currently have a problem with my focus when using a splash
I have an application written in C# and running on Windows Mobile 5. It
I am trying to create a game on the iPhone, however I am running
I have an iPad application that only supports landscape mode (just for a demo
My desktop-based WPF-application (4.0) works with DB and in order to this it should
I want to take a csv export of my bibtex literature database and analyse
I am trying to query a single entity in a database with a DataServiceQuery.
I'm making a table in emacs org-mode of sunrise-commander commands from the .el file
I been trying to passing this value: // Content to submit to php Others

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.