Window Items

Items of type window cause a particular window to be displayed at a given position on the canvas. Window items are created with widget commands of the following form:

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

The arguments x and y or coordList specify the coordinates of a point used to position the window 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 window items:

#:state
#:tags

The following extra options are supported for window items:

#:anchor anchorPos
AnchorPos tells how to position the window 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 window is centered on the point; if anchorPos is n then the window will be drawn so that its top center point is at the positioning point. This option defaults to center.
#:height pixels
Specifies the height to assign to the item's window. Pixels may have any of the forms described in the COORDINATES section above. If this option isn't specified, or if it is specified as an empty string, then the window is given whatever height it requests internally.
#:width pixels
Specifies the width to assign to the item's window. Pixels may have any of the forms described in the COORDINATES section above. If this option isn't specified, or if it is specified as an empty string, then the window is given whatever width it requests internally.
#:window #<widget>
Specifies the window to associate with this item. The window specified by #<widget> must either be a child of the canvas widget or a child of some ancestor of the canvas widget. PathName may not refer to a top-level window.

Note: due to restrictions in the ways that windows are managed, it is not possible to draw other graphical items (such as lines and images) on top of window items. A window item always obscures any graphics that overlap it, regardless of their order in the display list.


© Author | Home | Sitemap