Author: Paul McNett
Posted: 2012-03-22 at 12:57:59
Over the years, I've had occasional need for laying out a control left-aligned, and
another control right-aligned, in the same horizontal sizer. I know there are lots of
ways to do this but I finally figured out how to do it succinctly with a normal dSizer:
{{{
vs = self.Sizer ## vertical sizer in the form, panel, or whatever
left_control = dabo.ui.dCheckBox(self, Caption="left-aligned")
right_control = dabo.ui.dButton(self, Caption="right-aligned")
hs = dabo.ui.dSizer("h")
hs.append(left_control)
hs.appendSpacer(0, 1) ## proportion=1
hs.append(right_control)
self.Sizer.append(hs, "expand")
}}}
Simply append a horizontal spacer and set its proportion to 1 to tell it to take all
remaining available space. I guess I'd missed that spacers could have proportion set.
Paul
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4F6B6827.5030903@ulmcnett.com