beetlebug▾
/

canvas coords

Gives or sets the coordinates of an item.

PATHNAME coords TAGORID ?X Y ...?
PATHNAME coords TAGORID {X Y ...}

Description

With no coordinates, gives the coordinates of the first item of TAGORID. With coordinates, as words or as one list, replaces the coordinates of the item. The count of the numbers must suit the type of the item.

Returns

A list of numbers, or an empty string.

Examples

% canvas .co
> .co create rectangle 10 10 50 30
> .co coords 1 0 0 20 20
> .co coords 1
0.0 0.0 20.0 20.0

# No item has the ID 99.
% canvas .co2
> .co2 coords 99

Errors

% canvas .co3; .co3 coords
wrong # args: should be ".co3 coords tagOrId ?x y x y ...?"
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also