beetlebug▾
/

canvas find

Gives the IDs of the items that a search finds.

PATHNAME find above TAGORID
PATHNAME find all
PATHNAME find below TAGORID
PATHNAME find closest X Y ?HALO? ?START?
PATHNAME find enclosed X1 Y1 X2 Y2
PATHNAME find overlapping X1 Y1 X2 Y2
PATHNAME find withtag TAGORID

Description

Gives the IDs in the order of the display, from the lowest item to the highest:

Returns

A list of item IDs.

Examples

% canvas .fi
> .fi create rectangle 10 10 50 30 -tags box
> .fi create oval 60 10 90 40 -tags {round box}
> .fi find withtag {box && !round}
1

% canvas .fi2
> .fi2 create rectangle 10 10 50 30
> .fi2 create rectangle 100 100 120 120
> .fi2 find overlapping 0 0 20 20
1

Errors

% canvas .fi3; .fi3 find bogus
bad search command "bogus": must be above, all, below, closest, enclosed, overlapping, or withtag
-errorcode NONE

% canvas .fi4; .fi4 find closest 0
wrong # args: should be ".fi4 find closest x y ?halo? ?start?"
-errorcode NONE

Facts

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

See also