Image Items

Items of type image are used to display images on a canvas. Images are created with widget commands of the following form:

(#<widget> 'create 'image x y ?option value option value ...?)
(#<widget> 'create 'image coordList ?option value option value ...?)

The arguments x and y or coordList specify the coordinates of a point used to position the image on the display (see the #:anchor option below for more information). After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration.

The following standard options are supported by images:

#:state
#:tags

The following extra options are supported for images:

#:anchor anchorPos
AnchorPos tells how to position the image relative to the positioning point for the item; it may have any of the forms accepted by Tk_GetAnchor. For example, if anchorPos is center then the image is centered on the point; if anchorPos is n then the image will be drawn so that its top center point is at the positioning point. This option defaults to center.
#:image name, #:activeimage name, #:disabledimage name
Specifies the name of the images to display in the item in is normal, active and disabled states. This image must have been created previously with the image create command.

© Author | Home | Sitemap