The Slate supports a simple constraint mechanism. The mechanism is really just a simple notification mechanism, and allows scripts to be executed when certain kinds of operations are performed on items.
First, we'll create a Slate with some items on it:
source $tycho/editors/slate/doc/internals/newslate.itcl
set a [$slate create Frame 30 30 70 50 -color green -tags moveable]
set b [$slate create Frame 100 100 130 130 \
-color peachpuff -tags moveable]
set l [eval $slate create line \
[$slate aspect $a se] \
[$slate aspect $b nw] \
-tags moveable -arrow last]
$slate constraint $a "move" {lambda id x y -> \
$slate reshape $l $x $y "start"}
$slate constraint $b "move" {lambda id x y -> \
$slate reshape $l $x $y "end"}
Now, suppose we also want the boxes to move if we move the line. This
is simple enough -- attach a constraint to the line, so that
when it is moved, both boxes are moved:
$slate constraint $l "move" {lambda id x y ->
$slate move $a $x $y; \
$slate move $b $x $y }