Skip to content
Related Articles

Related Articles

Python – Statusbar in wxPython

View Discussion
Improve Article
Save Article
  • Last Updated : 10 May, 2020

In this article we are going to learn how can we add a status bar to wxPython frame. We can create status bar in frame using CreateStatusBar() function present in wx.Frame class. By default it has white background and dark gray text color.


wx.Frame.CreateStatusBar(self, number=1, style=STB_DEFAULT_STYLE,
                                     id=0, name=StatusBarNameStr)

Parameters :

ParameterInput TypeDescription
parentwx.WindowParent window. Should not be None.
numberintThe number of fields to create. Specify a value greater than 1 to create a multi-field status bar.
stylelongThe status bar style.
idwx.WindowIDThe status bar window identifier. If -1, an identifier will be chosen by wxWidgets.
namestringThe status bar window name.

Code Example :

# import wxython
import wx
class Example(wx.Frame):
    def __init__(self, *args, **kw):
        super(Example, self).__init__(*args, **kw)
    def InitUI(self):
        # create status bar
        self.statusBar = self.CreateStatusBar(style = wx.BORDER_NONE)
        # set text t status bar
        self.statusBar.SetStatusText("Status Bar")
def main():
    app = wx.App()
    ex = Example(None)
if __name__ == '__main__':

Output :

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!