我正在尝试为我的文本小部件创建一个滚动条,但是,我似乎无法 grid() 滚动条,因此滚动条没有出现在文本小部件上。忽略变量 Quote 中的内容,它只是测试数据。
EventScrollBar= tk.Scrollbar(EventChoice)
EventText=tk.Text(EventChoice,height=25,width=50)
EventText.grid(row=3,column=1,columnspan=5)
EventScrollBar.config(command=EventText.yview)
EventText.config(yscrollcommand=EventScrollBar.set)
Quote=("""
...
wd""")
EventText.insert(tk.END,Quote)
EventText.config(state=tk.DISABLED)
相关分类