python 可以自己定义变量以及变量类型
mystring = StringVar(
ticked_yes =
BooleanV
option1 = IntVar()
volume = DoubleVar()
Entry(root, textvariable = mystring)
Checkbutton(root, text="Remember Me",
variable=ticked_yes)
Radiobutton(root, text="Option1", variable=option1,
value="option1")
#radiobutton
Scale(root, label="Volume Control",
variable=volume, from =0, to=10) #slider
也可以通过 set get来设置或者获得变量值
myvar.set("Wassup Dude") # setting value of
variable
myvar.get() # Assessing the value of variable from say a
callback
解除绑定
widget.unbind(event)
entry.unbind(‘<Alt-Shift-5>‘)
root.unbind_all(‘<F1>‘)
root.unbind_class(‘Entry‘,
‘<KeyPress-Del>‘)