Python精灵模块的Checkbutton指令

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

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

简介:复选框组件,选中时值为1,不选中时没有值。
例子:

from sprites import Screen,Sprite,Checkbutton,IntVar,showinfo

screen = Screen()
screen.xy_grid()

var = IntVar()
ck1 = Checkbutton(100,400,text='显示轨迹',bg='white',
                  variable=var,command=lambda:showinfo(var.get()))

screen.mainloop()


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