如何在tcl/tk中绑定鼠标

如何在tcl/tk中绑定鼠标,tcl,tk,Tcl,Tk,我想绑定一个元素,这样当鼠标悬停在它上面时,它就会做一些事情。什么修饰符允许这种绑定?和事件。例如: place [frame .f -width 100 -height 100 -bg red] -x 10 -y 10 bind .f <Enter> {%W configure -bg blue} bind .f <Leave> {%W configure -bg red} 放置[frame.f-宽度100-高度100-背景红色]-x 10-y 10 bind.f{%

我想绑定一个元素,这样当鼠标悬停在它上面时,它就会做一些事情。什么修饰符允许这种绑定?

事件。例如:

place [frame .f -width 100 -height 100 -bg red] -x 10 -y 10
bind .f <Enter> {%W configure -bg blue}
bind .f <Leave> {%W configure -bg red}
放置[frame.f-宽度100-高度100-背景红色]-x 10-y 10
bind.f{%W配置-bg blue}
bind.f{%W配置-bg red}