I am currently working on a central widget with multiple layouts. I want to display few items in the statusbarin one widget and when I shift to the other widgets the items in the statusbar shouldn appear. How can I do this?

This may give you a hint ...

# a statusbar is an information line at the bottom of a frame
# set and clear the info

import wx

class MyFrame(wx.Frame):
    def __init__(self, parent, mytitle, mysize):
        wx.Frame.__init__(self, parent, -1, mytitle, size=mysize)
        # fill the top part with a panel
        panel = wx.Panel(self, -1, style=wx.SUNKEN_BORDER)
        panel.SetBackgroundColour("red")
        self.button = wx.Button(panel, -1, label='clear status bar', 
            pos=(20, 30))
        # bind button left mouse click to an action
        self.button.Bind(wx.EVT_BUTTON, self.action)

        self.sb = wx.StatusBar(self, -1)
        # set the status bar with three fields
        self.fields = 3
        self.sb.SetFieldsCount(self.fields)
        # set an absolute status field width in pixels
        # (negative indicates variable width field)
        self.sb.SetStatusWidths([-1, -1, -1])
        self.SetStatusBar(self.sb)
        # put some text into the fields (O is most left field)
        self.sb.SetStatusText("text in field 0", 0)
        self.sb.SetStatusText("text in field 1", 1)
        self.sb.SetStatusText("text in field 2", 2)
        
    def action(self, event):
        """clear the status bar text fields"""
        for field in range(self.fields):
            self.sb.SetStatusText("", field)


app = wx.App(0)
# create a MyFrame instance and show the frame
frame = MyFrame(None, 'basic wx.StatusBar', (400, 250))
frame.Center()
frame.Show()
app.MainLoop()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.