Over a million developers have joined DZone.

wxPython 101: Creating a Splash Screen

DZone's Guide to

wxPython 101: Creating a Splash Screen

A splash screen is a dialog with a logo or art on it that sometimes includes a message about how far along the app has loaded. Learn how to make one with Python!

· Web Dev Zone ·
Free Resource

Bugsnag monitors application stability, so you can make data-driven decisions on whether you should be building new features, or fixing bugs. Learn more.

A common UI element that you used to see a lot of was the Splash Screen. A splash screen is just a dialog with a logo or art on it that sometimes includes a message about how far along the application has loaded. Some developers use splash screens as a way to tell the user that the application is loading so they don't try to open it multiple times.

wxPython has support for creating splash screens. In versions of wxPython prior to version 4, you could find the splash screen widget in wx.SplashScreen. However, in wxPython's latest version, it has been moved to wx.adv.SplashScreen.

Let's look at a simple example of the Splash Screen:

import wx
import wx.adv

class MyFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY, "Tutorial", size=(500,500))

        bitmap = wx.Bitmap('py_logo.png')
        splash = wx.adv.SplashScreen(
                     5000, self)


# Run the program
if __name__ == "__main__":
    app = wx.App(False)
    frame = MyFrame()

Here we create a subclass of wx.Frame and we load up an image using wx.Bitmap. You will note that wx.Bitmap does not actually require you to only load bitmaps, as I am using a PNG here. Anyway, the next line instantiates our splash screen instance. Here we pass it the bitmap we want to show, a flag to tell it how to position itself, a timeout in milliseconds for how long the splash screen should show itself, and what its parent should be. These are all required arguments.

There are also three additional arguments that the splash screen widget can accept: possize, and style. You will note that in this example we tell the splash screen to center itself onscreen. We could also tell it to center on its parent via SPLASH_CENTRE_ON_PARENT.

You will, of course, need to modify this example to use an image of your own.

Wrapping Up

The splash screen is actually pretty useful if you have an application that takes a long time to load. You can easily use it to distract the user and give the illusion that your application is still responsive even when it hasn't fully loaded yet. Give it a try and see what you think.

Monitor application stability with Bugsnag to decide if your engineering team should be building new features on your roadmap or fixing bugs to stabilize your application.Try it free.

web dev ,python ,splash screen ,ui development ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}