[英]Tkinter Text widget. Linebreak breaking words
How can I make the linebreak in a Tkinter Text widget, not breaking words? 如何在Tkinter Text小部件中创建换行符,而不是破坏单词?
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 http://www.tutorialspoint.com/python/tk_text.htm
WRAP: This option controls the display of lines that are too wide. WRAP:此选项控制太宽的行的显示。 Set wrap=WORD and it will break the line after the last word that will fit.
设置wrap = WORD,它会在最后一个适合的单词之后断开。 With the default behavior, wrap=CHAR, any line that gets too long will be broken at any character
使用默认行为wrap = CHAR,任何过长的行都将在任何字符处被破坏
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.