CheckBox复选框,一个特定的两种状态的按钮,可以选中或取消选中。如果一个组中只有一个checkbox,则将成为单选按钮。
使用时通过CheckBox类生成一个复选框并设置相关样式,checkbox = CheckBox()
定义回调函数
def on_checkbox_active(checkbox,value):
if value:
print('checkbox',checkbox,'is active')
else:
print('checkbox',checkbox,'is inactive')
绑定回调函数:checkbox.bind(active=on_checkbox_active)
CheckBox常用的属性
属性 | 说明 |
active | 是否选中checkbox,默认False |
group |