Determining word wraps in Tkinter text widget

David Wangerin dwangeri at uci.edu
Wed Nov 28 21:24:46 CET 2001


> Not really an answer but you could try the Pmw.ScrolledTextbox mega-widget
> the scroll bars are dynamic (only seen if needed).
This would work but I am trying to avoid using horizontal scrollbars. 
The application is being used for a presentation in a graduate class
on UI, so making the interface consistent with our UI design
guidelines is important.

> What do you mean by floating widgets (do you mean window's inside the 
> textbox) or next to the textbox in an adjacent frame?
By floating, I mean that I have a frame on the side of the textbox
(it's filled so it is the same size as the textbox) that will contain
the widgets.  There will be a set of widgets corresponding to each
line in the textbox.  To keep the appearance of the text consistent, I
would like to keep the controls outside of the textbox.  As the text
is scrolled up or down, the frame with the widgets gets redrawn to
reflect the new viewable text.  If I lock the size of the textbox, I
can always know how many lines are being displayed, but whenever a
line wraps, I need to lower that number by one (I can't have two sets
of controls, one for the start of the line and another for the end of
the line).  Horizontal scrollbars would solve this problem, but I will
only use them as a last resort.

David



More information about the Python-list mailing list