Each picture has a configuration option called behavior. This option must be set to a command prefix on that object; the default is ``move.'' An interactor calls three ``action'' methods in the picture: click, drag, and release; all these methods do is append the behavior option, the action name, and (for the first two) the current coordinates.
For example, dragging some picture $picture might produce the sequence of calls:
$picture move click 100 100 $picture move drag 100 105 $picture move drag 102 109 $picture move releaseThe behavior option can be set to several other values. Firstly, the click mode always accepts the -ghost flag; to see the effect, let's change the behavior of the frame:
$frame configure -behavior {move -ghost}
$frame configure -behavior {deform ne}
Although this is sort-of cute, it's not really all that useful:
usually, you have other pictures that act as grab handles --
grapples, I call them -- so that you can move the picture.
Because of this, the shape classes provide their pictures with the
necessary support for adding grab handles. All that is required is to
ask the picture to create these handles:
$frame configure -behavior move
$frame grapple $follower
To remove the grab handles, provide a null value as the argument:
$frame grapple {}
$arrow configure -behavior {move -ghost}
$arrow grapple $follower -ghost