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

Robin Dunn robin at alldunn.com
Thu Jan 4 11:03:17 PST 2007


Christopher Barker wrote:
> krishnakant Mane wrote:
> 
>> well, the irony is that I am more comfortable with absolute positioning.
>> the screen coordinates and the idea of pikcell is in my mentel 
>> visualisation.
>> I am just trying to make my job a bit easy.  for me having mastery
>> over sizers would mean that I hav a sited assistant to help me out.
> 
> 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.
> 
> Here are some comments on what you wrote:

[...decomposition of layout snipped...]

This decomposition of a layout into component sizers is an excellent way 
to approach layout problems, and is how I usually teach people to do it. 
  There is a series of pictures in one of my OSCON presentations last 
year that might help to solidify this concept a bit more, (although 
without my commentary as you go through the slides it may not be much 
better than a bunch of pretty colored boxes, but you never know...)  The 
Sizers section starts at slide #56, and the visual decomposition slides 
start at #63.  The key is to learn how to divide up the layout into a 
series of boxes, and boxes within boxes, and then the relationship 
between the boxes determines what kind of sizers to use.

http://wxpython.org/OSCON2006/wxPython-intro-OSCON2006.pdf

Here is the source code that produces the screen-shot shown in the slides:

http://wxpython.org/OSCON2006/examples/realworld.py

And here is the same thing redone with XRC:

http://wxpython.org/OSCON2006/examples/realworld2.py
http://wxpython.org/OSCON2006/examples/realworld2_xrc.py
http://wxpython.org/OSCON2006/examples/realworld2.xrc

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list