beetlebug▾
/

text bbox

Gives the box of the character at INDEX.

PATHNAME bbox INDEX

Description

Gives four integers: the x and the y of the top left corner of the visible part of the character, its width, and its height, in pixels from the corner of the text. A character out of the view gives an empty list.

Returns

A list of four integers, or an empty list.

Examples

% text .bb
> .bb insert end hello
> pack .bb
> update
> llength [.bb bbox 1.0]
4

Errors

% text .bb2; .bb2 bbox bogus
bad text index "bogus"
-errorcode NONE

Facts

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

See also