Apologies for the poorly worded description below.

I *can* set my Text widget to a specific width. What I would like
to do is set my Text widget to a specific width, have it do its
layout with word wrap, then remove the width property so that the
Text widget can resize as its parent container resizes.

Is this possible?

Thank you,
Malcolm

----- Original message -----
From: pyt...@bdurham.com
To: "Python-Tkinter" <tkinter-discuss@python.org>
Date: Tue, 07 Dec 2010 11:07:43 -0500
Subject: [Tkinter-discuss] Force a Frame and/or Text widget to a
specific width?

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?

Thanks,
Malcolm
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to