text image
Puts images into the content, and gives or sets their options.
PATHNAME image cget INDEX OPTION
PATHNAME image configure INDEX ?OPTION? ?VALUE? ?OPTION VALUE ...?
PATHNAME image create INDEX ?OPTION VALUE ...?
PATHNAME image names
Description
create puts an image at INDEX and gives the name of the image in the text. The name is also an index. The options of an embedded image are:
-image IMAGE: the image ofimage create.-name NAME: the name in the text. The default is the name of the image, with a number after it when the name is in use.-align WHERE:top,center,bottom, orbaselinein the line.-padx DISTANCEand-pady DISTANCE: the space around the image.
cget and configure work on the image at INDEX. names gives the names of the images in the text.
Returns
The name of the image for create, a list for names, else as cget and configure.
Examples
% image create photo dot -width 4 -height 4
> text .im
> .im insert end abc
> .im image create 1.1 -image dot
> .im image names
dot
% image create photo dot2 -width 4 -height 4
> text .im2
> .im2 image create end -image dot2 -padx 3
> .im2 image cget dot2 -padx
3
Errors
% text .im3; .im3 image bogus
bad option "bogus": must be cget, configure, create, or names
-errorcode NONE
% text .im4; .im4 image cget nope -padx
bad text index "nope"
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1