canvas::highlight(3tk) | Variations on a canvas | canvas::highlight(3tk) |
canvas::highlight - Manage the highlighting of canvas items or item groups
package require Tcl 8.5
package require Tk 8.5
package require canvas::highlight ?0.1?
::canvas::highlight on canvas tagOrId cmd
::canvas::highlight off canvas tagOrId
{*}cmd on canvas item
{*}cmd off canvas clientdata
This package provides utility commands for setting up and tearing down of highlights for canvas items or item groups, the latter identified by a tag.
The signature of the command prefix is described later, in section Highlight callback.
The result of the command is the empty string.
Limitations:
The result of the command is the empty string.
The highlight 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 un-highlight callback for its use. In this manner the highlight callback is able to maintain custom state from highlighting to un-highlighting.
Note that the callback does not have to maintain state, nor does it have to actually reconfigure the item (group). In the latter case the callback simply serves as easy enter/leave notification.
The result of the command must be a boolean value with the usual value to be true. By returning false instead the callback can veto the removal of the highlight.
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, enter callback, highlighting, leave callback
0.1 | canvas |