Tkinter and frame resizing question

Matthew Dixon Cowles matt at mondoinfo.com
Mon Sep 24 23:36:52 EDT 2001


On Mon, 24 Sep 2001 22:40:13 +0200, Laura Creighton <lac at strakt.com>
wrote:

>When I use grid_remove() to remove a big frame, the window is
>redrawn from the top down, and so my tiny frame moves upwards.
>I don't want this.  I'd prefer to anchor the tiny frame to the
>bottom of the screen and then have the top of the window rise
>or fall depending on how many big frames I grid.  Does anybody
>know how to do this?

Dear Laura,
I don't think you're going to have much luck doing things that way.
At best, I think you'd have a window that bounced around the screen.
The reason for that is that the location of the upper left of your
window is under the window manager's control (you can use the
geometry() method to request that it be moved). I doubt that you'd
have much success in getting your window manager to move the window
down just as you were shortening your window. I'd suggest that you
consider a couple of alternatives:

You could put the frame with the control buttons near the top of your
window.

You could used a fixed-size frame (perhaps one with scroll bars) above
your control buttons and pack or grid your other frames into it. Pmw
has a scrolled-frame:

http://pmw.sourceforge.net/doc/ScrolledFrame.html

You could use a Pmw PanedWidget; it allows you to add and remove sub-widgets
and they can have varying heights:

http://pmw.sourceforge.net/doc/PanedWidget.html

Regards,
Matt



More information about the Python-list mailing list