简体   繁体   中英

Tkinter Text widget. Linebreak breaking words

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..."

根据http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/text.html ,选项wrap=tk.WORD应具有此效果。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM