Class ::tycho::Repeater


Inherits: ::tycho::Interactor - Source File - Contents: public variables - protected methods - protected variable
An interactor that repeatedly invokes a command while the mouse button is held down. As with all interactor callbacks, the called command has the current coordinates passed to it, so that the command can modify its action according to the current position within the picture.

Caveat: the command is still called repeatedly even if the mouse is moved outside the picture while the mouse is held down. This interactor should perhaps have another option that controls whether this happens or not.


Public constructs

Public Variables

-command
The command to execute repeatedly.
-delay 400
The time delay before next execution.
-interval 100
The time interval between executions.

Protected constructs

Protected Methods

activate t x y args
Attach the interactor to the current picture. After setting up bindings for the motion and release events, the -command script is executed, and a delayed call to reactivate set up for -delay milliseconds later.
deactivate args
Remove this interactor from the current picture. This removes the mouse bindings, cancels the delayed command, and clears the target.
motion x y
Record a change in mouse position.
reactivate x y
Reinvoke the interactor's activation command, and set up to call this again after the time specified by the -interval option.

Protected Variable

afterid
The id of the "after" script, so it can be cancelled.

Index of classes



Author: H. John Reekie
Version: @(#)Repeater.itcl 1.8 21 Oct 1996
Copyright: (c) 1996 The Regents of the University of California.