[Tutor] Tkinter packing confusion

Alan Gauld alan.gauld at freenet.co.uk
Tue Dec 28 11:15:57 CET 2004


> manager.  What I want to see is a window with something like this
(bear
> with my ascii art):
>
>   URL: [ http://www.somewhere.com/default ]
>
>   +--------+   +-------+  +----+
>   | Cancel |   | Reset |  | OK |
>   +--------+   +-------+  +----+
>
> What I'm getting is:
>
>        URL:
>     +--------+
>     | Cancel |
>     +--------+   [ http://www.somewhere.co ]
>   +-------++----+
>   | Reset || OK +
>   +-------++----+
>
>
> In the fButtons frame, I pack in the "Cancel" button as the top of

Top means you want packer to have a vertical arrangement.

> fButtons; then "Reset" to its right, and "OK" to its right.  Then I
pack
> in the fButtons frame.

right means a horizontal alignment.
So packer obediently puts the first button centre top,
and the other two horizontally spread out below it.

Simply use Right, (or left) for all the button packing and
it should be grand.

Alan G.



More information about the Tutor mailing list