0
私は、テキストウィジェットでスクロールバーを作成しようとしています。私はGoogleで検索し、既存のSOの質問を見たが、私は適切な例を得ていない。tkinterの既存の要素に属性を追加します。
mycontainer = Text(root)
scrollbar = Scrollbar(mycontainer)
scrollbar.pack(side = RIGHT, fill=Y)
#here I want to add the attribute of yscrollcommand into the mycontainer
mycontainer = Text(yscrollcommand = scrollbar.set) #Not working
for line in range(100):
mycontainer.insert(END, "This is line number " + str(line))
mycontainer.place(x=5, y=40, width=500, height=500)
scrollbar.config(command = mycontainer.yview)
どうすれば適切に行うことができますか?
質問表示のようなステートメントの順序を正確に使用したとき、私はもう3番目の問題を抱えませんでした。そして、 'scrollbar.activate( 'slider')' – Aemyl