Python精灵模块的Scale指令

所有命令 单独命令 屏幕命令 角色命令

单独命令 >> Python精灵模块的Scale指令

简介:同tkinter的滑块组件,只不过是绝对定位在画布上。
例子:
from sprites import Screen,Scale,TK

def change(text):
    screen.title(text)
    
screen = Screen()
screen.setup(480,360)

# 滑块
hk = Scale(160,150,from_=10,to=100,command=change,orient=TK.HORIZONTAL,
           label='选择',length=200,fg='brown',bg='lime')

# 启动事件循环
screen.mainloop()

writed by lixingqiu 关注"异编程"微信公众号,获取更多关于Python精灵模块的咨讯: