Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tkinter Text widget. Linebreak breaking words

Tags:

python

tkinter

How can I make the linebreak in a Tkinter Text widget, not breaking words?

Now:

"Lorem ipsum dolor sit amet, consectetur adipiscing el
it. Donec ornare neque a feugiat tristique. Suspendiss
e ultricies sem eu risus pellentesque interdum. Sed vu
lputate porttitor nibh..."

Want:

"Lorem ipsum dolor sit amet, consectetur adipiscing 
elit. Donec ornare neque a feugiat tristique. 
Suspendisse ultricies sem eu risus pellentesque 
interdum. Sed vulputate porttitor nibh..."
like image 419
user1121487 Avatar asked Jun 25 '13 11:06

user1121487


2 Answers

According to http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/text.html, the option wrap=tk.WORD should have this effect.

like image 66
Hans Avatar answered Oct 06 '22 16:10

Hans


http://www.tutorialspoint.com/python/tk_text.htm

WRAP: This option controls the display of lines that are too wide. Set wrap=WORD and it will break the line after the last word that will fit. With the default behavior, wrap=CHAR, any line that gets too long will be broken at any character

like image 25
vaasu Avatar answered Oct 06 '22 15:10

vaasu