A wx.StaticBoxSizer holds two BoxSizers. The first row has 4 widgets and
sets the StaticBoxSizer width. The second row has 3 widgets, left aligned.
I'm trying to center the second row within the StaticBoxSizer width, but
using Sizer.AddSpacer(size, 0, 0) prior to addting the second row's widgets
increases the vertical space between the two rows rather than adding space
to the left side of the second row.
Because I'm not finding the proper method to do this I will appreciate a
clue stick.
A wx.StaticBoxSizer holds two BoxSizers. The first row has 4 widgets and
sets the StaticBoxSizer width. The second row has 3 widgets, left aligned.
I’m trying to center the second row within the StaticBoxSizer width,
If I what you want right, you can add two spacers to the second row BoxSizer – it’s wx.HORIZONTAL, yes?
(untested)
second_row = wx.BoxSizer(wx.HORIZONTAL)
second_row.Add((1,1), 1)
second_row.Add(Window1, 0)
second_row.Add(Window2, 1)
second_row.Add(Window3, 1)
second_row.Add((1,1), 1)
that way, the spaders on the end will expand, with equal weights, to fit the space allocated, centering the three inner Windows.
Note that you MAY also be able to do this by adding the second row with the flag: wx.ALIGN_CENTER_HORIZONTAL
HTH,
-Chris
but
using Sizer.AddSpacer(size, 0, 0) prior to addting the second row’s widgets
increases the vertical space between the two rows rather than adding space
to the left side of the second row.
Because I’m not finding the proper method to do this I will appreciate a
clue stick.
TIA,
Rich
–
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception