tkinter text width

James Stroud jstroud at mbi.ucla.edu
Wed Apr 27 13:52:14 EDT 2005


On Wednesday 27 April 2005 02:31 am, so sayeth Eric Brunel:
> The "trick" is to create the Text as small as possible (width=1, height=1),
> make it fill its whole container (pack(fill=BOTH, expand=1)), then set the
> dimensions for the container window (geometry('500x200')). You'll get a
> Text that will shrink and expand as much as you like.
>
> Is it what you were after?

This is more or less what I would like, but I would also like to probe the 
Text to see how many characters it thinks it can display within the container 
window. I am formatting text dynamically and so I rely on the width. I am not 
after the built in "wrap" option, it does not do what I want. But, say if 
wrap were turned on, it would be good to know how many characters the Text 
would wrap at.

James

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list