python記事本之新增行文字編輯和右邊滑條滾動功能
import tkinter as my
# 右邊滾動下拉條
s1 = Scrollbar(root)
s1.pack(side = RIGHT,fill = Y)
#也可以寫成
s1 = my.Scrollbar(root)
s1.pack(side = my.RIGHT,fill = my.Y)
#s2 = my.Scrollbar(root,orient = HORIZONTAL)
#s2.pack(side = my.BOTTOM,fill = my.X)
# 文字編輯
m = Text(root,yscrollcommand=s1.set)
s1.config(command=m.yview)
#s2.config(command = m.xview)
#m.config(xscrollcommand = s2.set)
m.pack(expand = YES,fill = BOTH)