The Slate gives every item a set of aspects -- that is,
named points on the item. The aspects of an item depends on its shape,
and you can query the Slate for the shape of an item:
set slate [::tycho::Slate::demoslate]
set f [$slate create Frame 120 120 150 140 -borderwidth 4 -color green]
set l [$slate create line 30 30 30 50 50 50 50 70 -arrow last]
set s [$slate create Solid 100 20 120 20 120 10 140 30 120 50 120 40 100 40]
$slate shape $s
c
or center
, and the eight compass points:
n
, s
, e
, w
,
ne
, nw
, se
, and
sw
. An item with "line" shape has aspects
start
, end
, and one aspect of the form
vertex-n
of each vertex.
To query an item for an aspect, just use the aspect
method:
$slate aspect $f nw
$slate aspect $l vertex-0 vertex-1
If no aspects are given, this method return a list of
all aspects of the item:
$slate aspect $l
$slate moveto $l 2 2 start
start
.)
An item can be reshaped by specifying an aspect and
the distance to move it (click multiple times):
$slate reshape $f 10 10 se
More than one aspect can be moved if it makes sense to
do so (click multiple times):
$slate reshape $l 10 0 vertex-2 vertex-3
An item can also be reshaped by specifying an absolute
location for one of its aspects:
$slate reshapeto $l 100 100 end