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

Kevin Ollivier kevino at tulane.edu
Wed Jan 3 17:15:57 PST 2007


Hi Andrea,

On Jan 3, 2007, at 3:31 PM, Andrea Gavana wrote:

> Hi NG,
>
> On 1/3/07, Paul Koning <pkoning at equallogic.com> wrote:
>> >>>>> "Peter" == Peter Damoc <pdamoc at gmail.com> writes:
>>
>>  Peter> On 1/3/07, Chris Mellon <arkanes at gmail.com> wrote:
>>  >>  Absolute layouts are always wrong. Always.
>>
>>
>>  Peter> There are some cases where absolute is actually better...
>>  Peter> I've been experiencing the OS X for some time now and this OS
>>  Peter> is full of absolute positioning....
>>
>> 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.
>
> I remember a while ago Kevin writing about Mac-HIG advanced features,
> so I am bit lost right now... I thought that these guidelines could
> have been integrated in wx* by some clever programmer (maybe Kevin
> himself) because they were so advanced and well-suited to build an
> harmonious and neat GUI, while right now it seems to me that some
> (most?) of the Mac apps just apply absolute positioning... I am surely
> missing something here...

Well, only in the sense that on OS X, there is no easy "out of the  
box" way to change the default font, etc. To do so, you'd have to  
install third party software like TinkerTool (or, IIRC, look up how  
to change system prefs via command line). Therefore, it's much less  
likely that users would have customized system fonts, etc., and so  
developers don't bother to make sure their apps are HIG-compliant  
under any configuration than the OS default configuration. I'm not  
saying that's a GOOD thing, but that's how it is.

As for the HIG-compliant layout being integrated with wx, my  
SizedControls work is now in wxPython as of the 2.8.0.1 release and  
actually I've coded up some intro docs and a demo for 2.8.1, so you  
can see a couple simple demos on how it works. I'd love some feedback  
as one of the hardest things to do (successfully) is to put yourself  
in the shoes of someone who knows nothing about all that code you  
wrote and how it's supposed to work. ;-)

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. That's  
one big reason I made SizedControls work the way it does - the idea  
is that when you "drop" a control onto the parent panel, etc. on a UI  
form, it will automatically add the control to the parent's sizer,  
have the sizer determine the right layout, and apply necessary HIG- 
borders. So assuming there aren't any fundamental reasons this  
couldn't work in an UI designer, it's nearly as simple as absolute  
positioning when visually creating UIs (from the user's perspective),  
whereas current solutions are more like "draw (or visualize) mockup  
of UI, create sizer, add child sizer(s) if necessary, create control,  
add control to sizer".

Regards,

Kevin

> Andrea.
>
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.virgilio.it/infinity77/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users- 
> help at lists.wxwidgets.org
>





More information about the wxpython-users mailing list