[wxPython-users] Re: Sizing flag

Robin Dunn robin at alldunn.com
Fri Feb 9 08:40:09 PST 2007


Rooney, Mike (ext. 324) wrote:
> Thanks, but is there maybe a more general solution? The example shows
> four pop-ups to demonstrate how the other controls correctly work,
> but in reality the method that calls SetControl has no idea of what
> the control is, it could be anything. I could do instance checking or
> something but that isn't a very attractive solution. The way it works
> in our application is the method creating the dialog calls a
> GetEditWidget method which returns a wx control, which it passes to
> the dialog via SetControl. I guess I could have the GetEditWidget
> also return a center flag, but I feel like there must a way for this
> to work. I can use it as a last resort though.

Or you could have it pass back a sizer instead, and then just add that 
sizer to the main one.  The control can be sized, aligned, whatever as 
needed within it's nested sizer.


> If I understand you correctly the checkbox also contains a label,
> like a StaticText, which it is applying the EXPAND to? 

Yes, that is correct.  Try setting the background colour of the checkbox 
widget to see better where it is located and how it is sized.

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





More information about the wxpython-users mailing list