Bitmap Items

Items of type bitmap appear on the display as images with two colors, foreground and background. Bitmaps are created with widget commands of the following form:

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

The arguments x and y or coordList specify the coordinates of a point used to position the bitmap on the display (see the #:anchor option below for more information on how bitmaps are displayed). 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 bitmaps:

#:state
#:tags

The following extra options are supported for bitmaps:

#:anchor anchorPos
AnchorPos tells how to position the bitmap 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 bitmap is centered on the point; if anchorPos is n then the bitmap will be drawn so that its top center point is at the positioning point. This option defaults to center.
#:background color, #:activebackground bitmap, #:disabledbackground bitmap
Specifies the color to use for each of the bitmap's '0' valued pixels in its normal, active and disabled states. Color may have any of the forms accepted by Tk_GetColor. If this option isn't specified, or if it is specified as an empty string, then nothing is displayed where the bitmap pixels are 0; this produces a transparent effect.
#:bitmap bitmap, #:activebitmap bitmap, #:disabledbitmap bitmap
Specifies the bitmaps to display in the item in its normal, active and disabled states. Bitmap may have any of the forms accepted by Tk_GetBitmap.
#:foreground color, #:activeforeground bitmap, #:disabledforeground bitmap
Specifies the color to use for each of the bitmap's '1' valued pixels in its normal, active and disabled states. Color may have any of the forms accepted by Tk_GetColor and defaults to black.

© Author | Home | Sitemap