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

Re: [Xotcl] Linking object instance variables to a widget -textvariable?

From: Jeff Hobbs <jeffh_at_ActiveState.com>
Date: Sat, 15 Nov 2003 13:15:30 -0800

Uwe Zdun wrote:
> -opencmd "[self] modifyTree 1 $sw.tree" \
> -closecmd "[self] modifyTree 0 $sw.tree"]
> ...
> $tree bindText <ButtonPress-1> "[self] selectTreeElement $tree"
> $tree bindText <Double-ButtonPress-1> "[self] openTreeElement $tree"

And of course you always want to write core like the above as:

-opencmd [list [self] modifyTree 1 $sw.tree]
or
$tree bindText <ButtonPress-1> [list [self] selectTreeElement $tree]

otherwise you are asking for a maintenance headache.

-- 
     Jeff Hobbs, The Tcl Guy
     http://www.ActiveState.com/, a division of Sophos