View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] Small compatiblity problems with XOTcl 1.5.2 - tk bind

From: Artur Trzewik <mail_at_xdobry.de>
Date: Sun, 19 Nov 2006 18:53:54 +0100

Hi XOTcl friends!

I have found some small incompatibility between XOTcl 1.4 and 1.5 by
using XOTclIDE.
It considers tk binding

I use code as follow

bind $twin <KeyPress-Tab> [list [self] tabPress]

IDE::TclModeEdit instproc tabPress {} {
    # .....
    return -code break
}

the "return -code break" have caused that the event is not propagated more.
See more in Tk bind command manual.

It does not work with XOTcl 1.5.2.
I use small work around by wrapping XOTcl method in Tcl proc now.
XOTcl Method returns a boolean value.

bind $twin <KeyPress-Tab> [list tabPressHandler [self]]

proc tabPressHandler object {
      if {[$object tabPress]} {
          return -code break
     }
}

This incompatibility causes bad behavior in XOTclIDE editor.
(Code completion and automatic indenting).
I plan to ship next XOTclIDE version in some time without this problem.

Artur Trzewik