我最近重新访问了一个较旧的GUI项目,并决定其文本小部件需要一个垂直滚动条,因为输出通常很长。我一直无法找到这个,并且想知道我是否能得到一些帮助。这是必要的代码:
from Tkinter import *
class Application(Frame):
def __init__(self,master):
Frame.__init__(self,master)
self.grid()
self.widget()
def widget(self):
self.results_plain_label = Label(self,
text = "Deciphered Message")
self.results_plain_label.grid(row = 13, column =5, pady = 5 )
self.results_plain_text = Text (self, width = 100, height = 6,
wrap = WORD, font ("Times New Roman", ))
self.results_plain_text.grid(row = 14, column = 5, pady = 5, sticky = W)
Mainloop initialization stuff
那么,我如何在scroll-bar
文本框中添加results_plain_text
?