Search code examples
wxpython

wx.StatusBar - Why does my status bar add a gray box covering my panel?


Why does the following code add a gray box over most of the wxPanel?

statusBar = wx.StatusBar(frame)

However, nothing like that happens for other widgets like these:

textbox = wx.TextCtrl(panel, size = (300,20), pos = (10,30))
button = wx.Button(panel, size = (300,20), pos = (10,60), label = "Go")

Solution

  • You have to set the wxStatusBar to the frame like this:

    frame.SetStatusBar(statusBar)
    

    The status bar widget requires 2 lines of code to get started while most others just take 1 line of code.