@流吾思:我想写个checkbutton和button组合的按键,当checkbutton被选中后,button才起作用,这个应该怎么写?
pack [checkbutton .check -text "Check Me"] pack [button .button -text "Click Me"] .button configure -state disabled .check configure -command { .button configure -state [expr {[set [.check cget -variable]]?"normal":"disabled"}] } # bind .check <1> {.button configure -state [expr {[set [%W cget -variable]]?"normal":"disabled"}]}