[wxPython-users] how to get the screen size for an application

Josiah Carlson jcarlson at uci.edu
Thu Jan 4 00:25:31 PST 2007


"krishnakant Mane" <researchbase at gmail.com> wrote:
> 
> ok here is my doubt.
> it is a complex situation where I feel that no layout (box, grid etc) can work.
> I am creating a frame where there are 8 entry fields which are static
> text and TextCtrl pares.  and there are 6 buttons at the bottom of the
> screen for new entry, update, save etc.  now what I am doing is that
> having the entry fields in 2 columns which makes it 4 rows.
> and at the bottom of the screen I will leave some space above the
> status bar and put buttons one next to other in a streight line
> leaving some space at the left and right of the frame and keeping
> proper distance between the buttons.
> in the columns above i will have the static text followed by the
> textbox and then some gap and again a static text and the text box for
> entry so the individual lables and text boxes are grouped and there is
> space before the other pare comes.
> in the same way all the 4 rows are aranged.
> which layout can achieve this and how?
> I can see advantages in using a layout but find it very very complex
> indeed to use them.
> kindly explain this so that I can try out different combinations once
> I get this situation right.
> Krishnakant.

Krishnakant,

Attached you will find a layout using sizers that has labels and text
controls arranged as you specified, along with a row of 6 buttons with
spacers between them.  If the window is too small, scrollbars
automatically appear.  If the window gets larger, the controls or
spacers expand to fill space as necessary.

If the labels are significantly different lengths, one may want to go
with a FlexGridSizer instead.

 - Josiah
-------------- next part --------------
A non-text attachment was scrubbed...
Name: panel_layout.py
Type: application/octet-stream
Size: 2162 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070104/7b082eb6/panel_layout.obj


More information about the wxpython-users mailing list