I’m sure this is easy for you guys, but I’m having a hard time finding a solution to this…
I have a Frame that is constructed of a bunch of imported files to build a notebook… something like:
class myFrame(wx.Frame):
"""
Frame that holds all other widgets
"""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, wx.ID_ANY, "My Frame", size=(520,635))
panel = wx.Panel(self)
notebook = myFrameNotebook(panel)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5)
panel.SetSizer(sizer)
self.CreateStatusBar(style=0)
self.SetStatusText("Welcome to My Frame...")
self.Layout()
self.Show()
self.Centre()
I would like, from within the individual pages of the notebook to change the Status Text of the entire frame… If the above is called myFile, is there a way to SetStatusText from within a separate notebook page (which is stored in a separate file?)
What I’d like to do, for instance, is when you move from notebook page to notebook page, the status bar reflects where inside the application you currently are…?
Thanks much,
Chow (still new to wxPython)
It’s best to use PubSub for this, to decouple your class’ dependencies on another (and to reduce that GetParent().GetParent() noise 🙂 )