Statusbar not over the whole width (0/1)

Hello NG,

How can I create a statusbar, which is not so broad as the
width of the frame, so I can place buttons, ... beside it,
without actually integrating them into the statusbar.

Also if one changes the width of the frame by drag (sizer),
how can I keep the proportions of the display.

I attached two little screenshot to demonstrate this.

for example wx.StatusBar.SetSize ((600, 20)) shows no effect.

Thank you in advance

···

--
Franz Steinhäusler
http://drpython.sourceforge.net/
http://mitglied.lycos.de/drpython/

Franz Steinhäusler wrote:

Hello NG,

How can I create a statusbar, which is not so broad as the
width of the frame, so I can place buttons, ... beside it,
without actually integrating them into the statusbar.

Also if one changes the width of the frame by drag (sizer),
how can I keep the proportions of the display.

This works on Linux:

import wx

app = wx.App(0)
f = wx.Frame(None)
p = wx.Panel(f)

sb = wx.StatusBar(f)
sb.SetStatusText("some text")
b = wx.Button(f, -1, "a button")

sizer = wx.BoxSizer(wx.VERTICAL)
sizer2 = wx.BoxSizer(wx.HORIZONTAL)
sizer2.Add(sb, 1, wx.EXPAND)
sizer2.Add(b, 0)

sizer.Add(p, 1, wx.EXPAND)
sizer.Add(sizer2, 0, wx.EXPAND)

f.SetSizer(sizer)

f.Show()
app.MainLoop()

But it doesn't work on Windows. My guess is that there is something about the native statusbar that makes it always be the width of its parent. I'll ask about it on wx-dev though.

···

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