Links
The most numerous and best-developed set of interactors in Tycho are those that "track" movement of the mouse in some way. These interactors can all be cascaded -- for example, cascading a Bounder with a Stepper will move an item in discrete steps and keep it within a given region of the Slate.
-bounds
. A four-list giving the rectangular coordinates in
which to keep the target item. If it is the empty list, then the
Bounder keeps the target item within the coordinates of the slate.
-constrain
. This option further restricts
movement along certain axes. The default is "none." It can
have the following values:
none
: Move anywhere within the bounds
x
: Move only along the horizontal axis
y
: Move only along the horizontal axis
positive
: Move only along the positive diagonal axis
negative
: Move only along the negative diagonal axis
-stepsize
. The quantization step size. The default is 12.
-gridded
. If true, the cursor movement is quantized to a
grid with size given by the -stepsize
option. Otherwise,
the change in coordinates is quantized (the default).
The Repeater interactor is used to provide recurring stimulus while the mouse is held down. Once activated on an item, it executes a command it fixed time intervals for as long as the mouse is held down. It is used, for example, in the Slider widget to move the slider bar while the mouse is pressed anywhere above or below the bar.
Repeater adds the following options:
-command
. The script that is executed repeatedly as
long as the mouse button is held down.
-delay
. The time delay between the first and second clicks.
-interval
. The time interval between executions of the script.
The Tk canvas (and thus the Slate) provides no built-in editing capabilities for text. The TextItemEdit interactor encapsulates the code needed by the Slate to support basic interactive editing on text items. Note that this is intended only for editing small items like labels in diagrams.
The interactor is attached to one or a set of Slate items with the
bind
command (as usual). Once activated, the insertion
cursor remains in the text item until the stop
method is
called. How this method is called depends on the client -- it will
usually be by the user clicking on a different object. (The
usual click-drag-release sequence is used in this interactor, but
to drag-select text.)
While an item has the insertion cursor, the text can be edited as follows:
The Selector interactor provides the Slate with a general
selection mechanism. In effect, it coordinates a number of interactors
in order to achieve complex user interaction. By default, the Slate
contains a single Selector object that can be accessed through the
selector
, select
, and deselect
method. In more complex editors, multiple selectors can be created
(such as for selecting within different hierarchical items).
More detail on the selection mechanism is given in Managing graphical selections.