[Tkinter-discuss] Force a Frame and/or Text widget to a specific width?

python at bdurham.com python at bdurham.com
Tue Dec 7 17:07:43 CET 2010

Is there a technique where I can force a Frame and/or Text widget
to a specific width? I understand that width= many times only
serves as a hint to Tkinter's layout managers. I'm looking for a
width setting technique that's much more forceful than a
suggestion :)

I'm using a Text widget with wrap='word' as a multi-line label. I
pack this Text widget into a Frame.

This Text widget wants to grow to a certain width inspite of
setting a specific (char) width for Text and a specific (pixel)
width for its parent Frame.

The only way I can control my Text widget's width is by placing
it in a window with a max width set via .maxsize( width, ... )
and resizing disabled via resizable( False, False ).

If I skip the resizable( False, False ) statement, then I get the
proper sized Text/Frame *until* I go to resize my window ... as
soon as I go to resize my window, it snaps to the width it wants
to go to when I don't force maxsize().

BTW: I'm using 32-bit Python 2.7 for Windows.

Am I missing something obvious?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20101207/7d0cf248/attachment.html>

More information about the Tkinter-discuss mailing list