how to get the screen size for an application

so will it also work if my controls are laid out manually on the
frame? for example if the frame is centered, what will it mean by
putting a button at point 0,0 on the centered frame?
wil it position itself relative to the starting point of the frame

(which will be some thing at the centerof the screen)?

yes, it will work. the frame is centered on the screen desktop. the desktop background is just a kind of a special window. button at (0, 0) will stay at (0, 0), after the frame is centered on the screen.

I am not finding laying out controls with sizers a good technique (may
be I am wrong and correct me if so).

usually the sizers are a better way to layout your widgets. there are situations, where manual layout fits well. ( many people would say, do not use manual layout at all, but I don’t agree. ) I know Swing as well and I know exactly what you mean. I have

heard countless of times people crying: swing layout managers are difficult to use!
and the swing developers at sun replied: you can use Netbeans and their visual buider.
Now you can see, how mysteries and myths are born. Swing layout managers are a bit more complicated, but it does not mean, they cannot be understood. the problem is only that there is not a complete and easy to understand tutorial or guide that would explain them. and that people are lazy. I bet the second reason is more relevant.
Each developer must understand layout managers inside out. Couple of weeks studying them will pay off later on.

If you are a master at Swing, wxPython is than a peace of cake. it is a way less complicated.
I recommend you to look at wxPython code in some applications to get the -feeling-. So that
you do not think in terms of Swing in wxPython.

-jan bodnar

There are some cases where absolute is actually better…
I’ve been experiencing the OS X for some time now and this OS is full of absolute positioning…

In a lot of cases it makes sense…
I’m now arguing that absolute is better for all cases… just that sometimes is just better to have a complete control over where a certain component will end up…
It might not be very portable or very good in some cases… but it has it uses…

My 2 eurocents.

Peter.

···

On 1/3/07, Chris Mellon arkanes@gmail.com wrote:

Absolute layouts are always wrong. Always.


There is NO FATE, we are the creators.

Lots of existing code, including code from OS vendors, does absolute
positioning. And I agree with Chris that this is always wrong. The
fact that it's a popular bug doesn't make it any less a bug.

One way to see how wrong this is: increase the UI font size (using
TinkerTool on Mac OS, for example). Observe how the UI becomes a
total mess, with UI text labels truncated all over the place and
things mispositioned.

If Apple had done the job correctly, this would not have been a
problem.

  paul

···

On 1/3/07, Chris Mellon <arkanes@gmail.com> wrote:

>> Absolute layouts are always wrong. Always.

> There are some cases where absolute is actually better...
> I've been experiencing the OS X for some time now and this OS
> is full of absolute positioning....

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.

Do you try to use Sizers?

···

2007/1/4, krishnakant Mane researchbase@gmail.com:

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.


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org


Saludos / Best regards

Mario Lacunza
Desarrollador de Sistemas - Webmaster
Desarrollador 2 Estrellas VS2005

Email: mlacunza [AT] gmail [DOT] com
Website: mlacunzav[DOT]cogia[DOT]net
Blog: http://mlacunza.blogspot.com/
Lima - Peru

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

panel_layout.py (2.11 KB)

···

"krishnakant Mane" <researchbase@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.

You can prototype with sizers too, just as easy. If you have tools that help you, like wxGlade, mocking up a GUI is very very easy just that sometimes it doesn’t scale for complex screens.

The point where I started to feel the need for absolute positioning was when I created a crowded UI where there were a lot of components that NEEDED to fit on a 1024x768 screen. There was almost no room for fluidity. In the end the whole thing ended up with a little bit of “skinning” (some gradient background with “zones” that were delimited by blocks of color that dropped shadows) and the whole thing ended up having lots of sizers inside sizers inside panels to finally create something that would have been very easy to create with absolute positioning.

Sure there are accessibility issues with absolute positioning, especially if you don’t get support for proper screen DPI handling or if you go multi-platform BUT in vertical markets you are forgiven. :wink: You can even get away with something like “Sure you can use it on your Mac… just install Parallels” :wink:

Peter

···

On 1/4/07, Kevin Ollivier kevino@tulane.edu wrote:

BTW, this is just my guess, but I think most people who use absolute
positioning do so not because they are very particular about a
control being “right at this spot” on the form (though there are some

like that), but more because absolute positioning makes UI design as
simple as “drag, drop, done”. That’s great for prototyping.


There is NO FATE, we are the creators.