开发者

Simple wxPython Frame Contents Resizing - Ratio?

I have a wxPython app with one frame and one panel. On that panel are a number of static boxes, each of which has buttons and textboxes.

I have just begun reading about sizers, but they seem like they might be more than what I need, or it could that they are exactly what I need but I don't know how to use them correctly!

The frame currently opens at 1920 x 1080. If the user drags the bottom right corner to resize the app, I just want everything to get smaller or larger as needed to keep the same size ratio.

Is this possible?

Thank you!

edit: additional info: I used wxPython 2.8 and Boa to construct the GUI. I am contemplating trying another gui ide.

So after reading some more about sizers, I am thinking about doing the following: add a gridsizer and basically divide my window's elements into rows and columns, then s开发者_运维知识库et each row and column's size as necessary until I achieve the original layout. Then I guess set the rows and columns to resize correctly? Is this a decent idea?


For complex layouts, I sketch it out on a piece of paper. Then I draw boxes around the widgets in different ways to decide what sizers to use. You can nest pretty much any sizer inside another one. If the controls naturally fit in a grid, then using a grid sizer of some sort is probably alright. If not, then use BoxSizers. I tend to use those the most.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜