Is this a property of the sizer or its contents? And one "or's"
wx.VERTICAL_ALIGNMENT_CENTER to the relevant Style attribute, yes? Finally, how
does one specify that a sizer (as opposed to a spacer) should expand (e.g.,
horizontally) with resizing of a window? Thanks!
If you want to align your widgets to a side of the size, use wx.ALIGN_LEFT, wx.ALIGN_RIGHT, wx.ALIGN_TOP or wx.ALIGN_BOTTOM. Otherwise, if you want the widget(s) in the center, then wx.ALIGN_CENTER is probably what you want. To get a widget to stretch when the frame is resized, you’ll want to use the wx.EXPAND flag. Although if it is expanding, then I don’t really see any point in aligning it. And yes, these are all style flags. To combine them, you just do something like this:
wx.EXPAND | wx.ALL
Note the “|” character.
Mike
···
On Friday, March 22, 2013 12:42:27 AM UTC-5, OlyDLG wrote:
Is this a property of the sizer or its contents? And one “or’s”
wx.VERTICAL_ALIGNMENT_CENTER to the relevant Style attribute, yes? Finally, how
does one specify that a sizer (as opposed to a spacer) should expand (e.g.,
horizontally) with resizing of a window? Thanks!
you put it in a size, and set it's flags like any other item in a sizer.
When the top-level sizer is set on the Window:
self.SetSizer(The_Sizer)
it is set to fill the Window (if the items in it expand, at any rate.
Check out the WIT to see it all in action.
-Chris
···
On Thu, Mar 21, 2013 at 10:42 PM, OlyDLG <eulergaussriemann@gmail.com> wrote:
Finally, how
does one specify that a sizer (as opposed to a spacer) should expand (e.g.,
horizontally) with resizing of a window? Thanks!
--
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
Is this a property of the sizer or its contents? And one "or's"
wx.VERTICAL_ALIGNMENT_CENTER to the relevant Style attribute, yes?
Yes. Assuming there is more vertical space allocated to the item than what it needs, then that should adjust the position of the item within that space.
Finally, how
does one specify that a sizer (as opposed to a spacer) should expand (e.g.,
horizontally) with resizing of a window? Thanks!
That depends on the type of sizer and its orientation. In a vertical box sizer if an item has the wx.EXPAND flag then it will be stretched horizontally to fill the space given to the sizer. If it has a proportion > 0 then that indicates how much of the extra space vertically the item will get. Reverse those concepts for a horizontal box sizer.