Hello,
When adding a statusbar, it messes the layout: The listbox and button are on top of each other.
Why is that? What’s the fix?
Thank you.
import wx
class ListBoxFrame(wx.Frame):
def __init__(self, *args, **kwargs):
super().__init__(None, -1, title="Statusbar messing layout")
self.Centre()
panel = wx.Panel(self, -1)
sizer = wx.BoxSizer(wx.VERTICAL)
#BAD!
self.statusbar = self.CreateStatusBar()
self.lb1 = wx.ListBox(panel, wx.ID_ANY, style=(wx.LB_SINGLE | wx.LB_ALWAYS_SB))
sizer.Add(self.lb1,proportion=1, flag=wx.ALL | wx.EXPAND, border=5)
self.dload_btn = wx.Button(panel, wx.ID_ANY, "Test")
sizer.Add(self.dload_btn,proportion=0, flag=wx.EXPAND)
self.dload_btn.Bind(wx.EVT_BUTTON, self.do_work)
panel.SetSizer(sizer)
def do_work(self, event):
self.statusbar.SetStatusText("blah")
app = wx.App()
ListBoxFrame().Show()
app.MainLoop()