An overview of the Interactor classes

Contents

Links

Mouse tracking interactors

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.

Follower

Follower just follows the mouse exactly. It is the most basic kind of mouse tracker, and is the superclass of all other mouse trackers. It has no options other than those in the Interactor superclass.

Bounder

Bounder moves an item, but keeps it within a rectangular region of the Slate. It can also constrain the movement of the item in other ways. It adds the following options:

Stepper

Stepper quantizes the mouse movement. It adds the following options:

Repeater

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:

TextItemEdit

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:

Selector

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.

Back up
Tycho Home Page


Copyright © 1996-1998, The Regents of the University of California. All rights reserved.
Last updated: 05/12/98, comments to: johnr@eecs.berkeley.edu