我曾尝试设计tkinter的滚动条,而不是使用ttk滚动条
但我无法在滚动条上实现设计。我想我已经实现了与effbot文档中相同的配置选项
from tkinter import *
testing=Tk()
a=Listbox(testing,height=6)
sc=Scrollbar(testing,orient=VERTICAL,command=a.yview)
for i in range(100):
a.insert(END,i)
a.config(yscrollcommand=sc.set)
def designs():
# This function does nothing :(
sc.config(background='orange',borderwidth=34)
sc.config(highlightthickness=30,highlightcolor='orange',highlightbackground='skyblue')
sc.config(troughcolor='orange')
designs() # here...
sc.pack(side=RIGHT,fill=Y)
a.pack()
testing.mainloop()
有没有办法改变滚动条槽部分和非槽部分的背景颜色以及一些效果,如活动背景?请帮忙
目前没有回答
相关问题 更多 >
编程相关推荐