Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种简单的方法(可能通过标志)来使Text小部件水平滚动,当里面输入的文本超出范围时。如果您知道垂直滚动到的方法,请告诉我。
Text
在小部件中禁用自动换行Text。当您键入超过行尾时,文本将水平滚动:
try: from Tkinter import * # Python 2 except ImportError: from tkinter import * # Python 3 root = Tk() t = Text(root, wrap=NONE) t.pack() root.mainloop()
垂直滚动是免费的。