Switching Between Panels In wxPython GUI

Image for post
Image for post
Photo by Shunya Koide on Unsplash

wxPython is a powerful cross-platform GUI toolkit for the Python language. In this post I will show how to replace dynamically the content of a window in wxPython.

Image for post
Image for post

Before answering this question, here is the command line for installing wxPython:

pip install wxpython

The following code snippet demonstrate how to allow switching between panels in wxPython using the PanelSwitcher class which is derived from wx.BoxSizer. You can copy the code of PanelSwitcher from the snippet below into you project.

Written by

Software developer & architect. CTO at MedDev Soft

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store