Re: sizers and proportions

Tim Roberts <[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
On Nov 15, 2019, at 11:52 PM, [email protected] wrote:
> 
> I am trying to wrap my mind around the proportion values in the .Add methods for the various sizers.
>  
> If I have a horizontal box sizer, and I add two vertical box sizers and I want the left one to be 1/3 of the window and the right to be 2/3 of the window,  would my proportions be for the left 1, and the right 2?

Correct!


> What if I had 4 equal sized areas, would the proportions be 1 for each control? And would the number of controls matter? If I wanted them to take up the same space, so if it was 4,5,6 etc the proportion would just be 1 for all of them right?

Correct!  I think you have an excellent grasp of the concept.


> Last question these are just exercises to understand how this is done:
>  
> I saw an issue on the internet that someone was trying to add three text controls to a horizontal box sizer.  He needed the proportions to be 4, 3, 16 respectivly.  Given these numbers what would this do?

The three boxes would be 4/23, 3/23 and 16/23 of the total space.  So, the first box is about 1/4 the size of the final box, and the one in the middle is a bit smaller.

Sizers are one of the reasons I use wxWidgets even for my Windows-only C++ work.  It just makes layout management so much easier,.
— 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/1AD0A5A0-1C7A-411A-8A50-D91D170E8958%40probo.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.