[wxPython] SetStatusBar method

Hi all,

I cannot get SetStatusBar method to work, e.g. the following code shows nothing

from wxPython.wx import wxApp, wxFrame, wxStatusBar

class App(wxApp):
“”“The top application class.”""

def OnInit(self):
    #Create frame.
    frame = wxFrame(None, -1, "Test frame widget.")

    stb = wxStatusBar()
    frame.SetStatusBar(stb)

    #Show frame and set it as the top one.
    frame.Show(1)
    self.SetTopWindow(frame)

    #Return value to enter mainloop.
    return 1

a = App(0)
a.MainLoop()

I tried every combination I could think of with SetStatusBar but nothing worked.

OTOH the following ways to create a status bar work:

  1. use wxFrame method CreateStatusBar()

  2. use wxStatusBar(frame, -1) (NOT followed by SetStatusBar() of course, because if we do it, nothing happens again.)

Anybody knows what I am missing to make the SetStatusBar frame method work?

Thanks,

Gonçalo Rodrigues

I cannot get SetStatusBar method to work

It works fine in the demo. Check how it's done there.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!