canvas::drag(3tk) | Variations on a canvas | canvas::drag(3tk) |
canvas::drag - Manage the dragging of canvas items or item groups
package require Tcl 8.5
package require Tk 8.5
package require canvas::drag ?0.1?
::canvas::drag on canvas tagOrId cmd option...
::canvas::drag off canvas tagOrId
::canvas::drag item canvas tagOrId option...
::canvas::drag group canvas tagOrId cmd option...
{*}cmd start canvas item
{*}cmd move canvas clientdata dx dy
{*}cmd done canvas clientdata
This package provides utility commands to setup and rmeove dragging of items or item groups on a canvas, hiding all complexity regarding bindings from the user.
The signature of the command prefix is described later, in section Drag callback.
Similarly, the accepted options and their values are described in section Options
The result of the command is the empty string.
The result of the command is the empty string.
It uses an internal standard callback for this.
The result of the command is the empty string.
It uses an internal standard callback for this. The callback cmd specified has the same signature as the Drag callback, except that
The result of the command is the empty string.
The drag callback is a command prefix invoked in the following two ways:
The result of the command can be anything. It is stored by the system as client information and passed unchanged to the movement callback for its use. In this manner the drag callback is able to maintain custom state from start to movement.
The result of the command can be anything. It is stored by the system as client information and passed unchanged to the next movement callback for its use. In this manner the drag callback is able to maintain custom state from movement to movement.
The result of the command is ignored.
The commands to create drag operations (on, item, and group) all accept the following options to configure the new drag.
To initiate a drag operation by pressing mouse button 3 on a drag handle, use:
-event 3
To initiate a drag operation by pressing mouse button 2 on a drag handle while holding down the Control key, use:
-event Control-2
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category canvas of the Tklib Trackers [http://core.tcl.tk/tklib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation.
canvas, dragging
0.1 | tklib |