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

krishnakant Mane researchbase at gmail.com
Thu Jan 4 11:32:51 PST 2007


hi Chris
On 04/01/07, Christopher Barker <Chris.Barker at noaa.gov> wrote:

>
> Your visual impairment certainly changes the situation for you, but when
> I read your previous mail it cemented my feeling that the way we
> naturally think is layout manager oriented -- not pixel coordinates. In
> your description of what you needed, I didn't read a single pixel
> coords, what I read was a discussion of how the widgets relate to
> each-other.
>
no, coordinates was my real problem along with sizing and related issues.
reading your email gives me some comfort now.

> Here are some comments on what you wrote:
>
> > there are 6 buttons at the bottom of the
> > screen for new entry, update, save etc.
>
> This is a vertical box sizer -- the 6 buttons on the bottom, the other
> controls on the top.
ok but I will like to leave some wide gap between my 4 rows with edit
fields and the line of buttons, will I be able to do that?
and if the box sizer is vertical, how can I put a custom grid of
lebel-text pares?
> > now what I am doing is that
> > having the entry fields in 2 columns which makes it 4 rows.
>
> A GridSizer or FlexGridSizer.
the layout will be not actually 2 colums but 4 columns.  a lable-text
pare with very little space between the static text and the textctrl
then some significant gap before the other pare.  means column 1,2
with little or no space and then some significant space and then
column 3 and 4.  then some line gap for the next row and follow the
same thing.
> > 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
>
> A Horizontal Box Sizer.
>
ok got the point but will I be able to change the sizes of the buttons
once I tell the box to lay them on the screen?
I will like to make some buttons a bit small and add more space to
give some additional visual hint.
> > leaving some space at the left and right of the frame and keeping
> > proper distance between the buttons.
>
> A spacer at each end -- and maybe in between the buttons, depending on
> what you want.
>
can a spacer be altered for different sizes and how?  I don't have a
comprehencive tutorial on these layouts and will surely like to try.
> > 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 labels and text boxes are grouped and there is
> > space before the other pare comes.
> > in the same way all the 4 rows are arranged.
>
> That's exactly what a Grid sizer is for. With absolute positioning, if
> you change one of the labels, ALL the positions need to change. With
> Sizers, this is taken care of for you.
>
> This is a key point:
>
I want to know if my code will become to complex if there are two many
controls and if yes how to avoid it?
regards.
Krishnakant.




More information about the wxpython-users mailing list