【问题标题】:How to callbacks events like bind in incr tcl?如何回调 incr tcl 中的绑定等事件?
【发布时间】:2016-12-25 07:20:44
【问题描述】:

例如我试过这个:

package require Itcl
package require Tk

::itcl::class X {
    constructor { } {
    canvas .c -height 200 -width 200
    bind .c <ButtonPress-1> {::itcl::code $this A}
}
method A { } {
    puts "inside A"
}
}
X aa

但是在画布上单击鼠标后它不会进入方法 A 吗? 请在这里帮助我。

【问题讨论】:

    标签: itcl


    【解决方案1】:

    我找到了解决方案: 将 {::itcl::code $this A} 更改为 [::itcl::code $this A]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多