开发者

TKinter: a slider widget?

Is there a slider widget in TKinter libraries ?

I need a slider t开发者_运维技巧o set a specific value


See the effbot docs:

from Tkinter import *

master = Tk()
def vscale_cb(value):
    print('vertical: {v}'.format(v=value))
def hscale_cb(value):
    print('horizontal: {v}'.format(v=value))

w = Scale(master, from_=0, to=100, command=vscale_cb)
w.pack()

w = Scale(master, from_=0, to=200, orient=HORIZONTAL, command=hscale_cb)
w.pack()

mainloop()


Yes there is a tkinter slider:

from tkinter import *
root = Tk()
scale = Scale(root, from_=0, to=100)
scale.pack()
root.mainloop()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜