Hi All - Newby

Tim Roberts timr at probo.com
Sat Oct 29 14:45:27 EDT 2005


"Ask" <pu at pmville.com> wrote:
>
>Hi TIm,
>
>Ahh I see.. (Told you I was a newby!)  ;-)
>
>Tkinter is what I'm using as that was loaded by default with the 
>installation of Python I am using.

Now your question makes good sense, especially if you were coming from
something like the Win32 API.

In Tkinter, as in MOST of the GUI toolkits for Python, you dont just place
a widget at a specific X,Y with a specific width and height.  The problems
with that kind of approach are well known; such layouts don't scale with
different fonts, they look bad when the owning window is stretched, they
don't compensate for screen sizes, etc.

The various toolkits have different methods for managing this.  In Tk, the
concept is called a "geometry manager".  You use a geometry manager to
define the RELATIONSHIP between widgets, and between the widgets and the
owning window.  The geometry manager, then, worries about the exact
placement and size.

Googling for "tkinter geometry manager" should prove fruitful.  Here is an
excellent introduction:

http://effbot.org/zone/tkinter-geometry.htm

There is a fabulous book called "Python and Tkinter Programming" by John
Grayson, ISBN 1884777813.  If you will be getting serious with Tkinter, I
strongly recommend it.

Personally, I started with Tkinter, but I couldn't wrap my brain around the
details.  I switched to wxPython, and never looked back.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list