简体   繁体   English

Tkinter文本小部件。 Linebreak打破单词

[英]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.

相关问题 Tkinter文本小部件。 取消选择文字 - Tkinter Text widget. Unselect text 允许用户在tkinter条目小部件中更改默认文本。 - Allow user to change default text in tkinter entry widget. 在文本小部件中(tkinter)搜索单词/字母 - Search for words/letters in the text widget (tkinter) 按钮中的命令在不显示按钮小部件的情况下执行。(Python tkinter) - Command in the button executes without showing the button widget.(Python tkinter) 根据列表中的位置更改Tkinter Text小部件中某些单词的颜色 - Change color of certain words in Tkinter Text widget based on position in list 将tkinter文本小部件配置为代码编辑器。 在doubleclick上选择单词 - configure tkinter text widget as code editor. select words on doubleclick 如何在 tkinter 文本小部件中找到整个单词而不是单词的字符串部分 - How find whole words in tkinter text widget and not strings part of a word 如何在python中的Tkinter文本小部件中优化标记的单词? - How to optimize tagged words in the Tkinter Text Widget in python? Python 3 Tkinter | 在文本小部件中的':'之间更改单词的颜色/样式 - Python 3 Tkinter | Change color/style for words in between ':' in Text Widget 如何更改 tkinter 文本小部件中某些单词的颜色? - How to change the color of certain words in the tkinter text widget?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM