ClassyTcl

  Canvas

Home    Documentation    Screenshots    Binary distributions    Source distribution   

subclass of Widget
Classy::Canvas creates a canvas widget that supports undo and redo, save and load, selection and grouping. Most options and commands are identical to those of the standard Tk canvas.
Classy::Canvas reserves tags starting with an underscore (_) for internal use (temporary tags, grouping etc.). You should not add or remove such tags, except for the group names returned by the group method.

Canvas specific methods

pathname undo ?action? ?args?
Without arguments, this method will undo the previous action When action is provided, it can have the following values
check
insert a checkpoint
clear
clear undo buffer
add
add ?args? to undo buffer, they will be executed when undo is called
off
turn undo buffering of
on
turn undo buffering on
status
query state of undo
pathname redo
redo undone actions
pathname noundo ?args?
execute command without storing in undo buffer
pathname addtag tag searchCommand ?arg ...?
This command is identical to that of the standard canvas widget, but supports some extra searchcommanda:
items
all given items
tags
all items with one of the given tags
andtags
all items with all of the given tags
pathname find tag searchCommand ?arg ...?
This command is identical to that of the standard canvas widget, but supports some extra searchcommanda:
tags
all items with one of the given tags
andtags
all items with all of the given tags
pathname current ?item?
returns the current item. If current is given, it changes the the current item to the item given.
pathname save ?tag?
returns a list that can be used to restore the drawing in the canvas using a load command. This can be saved to a file for permanent storage. If tag is given, only items with tag $tag will be saved instead of all items.
pathname group searchcommand ?arg? ...
creates a new group, consisting of items found by the searchcommand. searchcommand has the same options as in the addtag method. The method returns the name of the group. The group name can be used as a tag, in order to perform actions on group members. Adding the group name as a tag to an item will add the item to the group.
pathname findgroup tagOrId
returns the main group of an item: This is the last one the item was added to. If tagOrId is a tag that refers to more than one item, the first (lowest) such item is used.
pathname cut ?tagOrId?
copies a description of the objects given by tagOrId to the clipboard
pathname copy ?tagOrId?
copies a description of the objects given by tagOrId to the clipboard
pathname paste
creates new objects from a description put on the clipboard by the copy or cut method
pathname print
pops up a print dialog and prints the current canvas.
Peter De Rijk
hosted at SourceForge.net Logo