如何在Tkinter Text小部件中创建换行符,而不是破坏单词?
现在:
"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..."
想要:
"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..."
答案 0 :(得分:6)
根据http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/text.html,选项wrap=tk.WORD
应具有此效果。
答案 1 :(得分:2)
http://www.tutorialspoint.com/python/tk_text.htm
WRAP:此选项控制太宽的行的显示。设置wrap = WORD,它会在最后一个适合的单词之后断开。使用默认行为wrap = CHAR,任何过长的行都将在任何字符处断开