Embedded Windows

The third form of annotation in text widgets is an embedded window. Each embedded window annotation causes a window to be displayed at a particular point in the text. There may be any number of embedded windows in a text widget, and any widget may be used as an embedded window (subject to the usual rules for geometry management, which require the text window to be the parent of the embedded window or a descendant of its parent). The embedded window's position on the screen will be updated as the text is modified or scrolled, and it will be mapped and unmapped as it moves into and out of the visible area of the text widget. Each embedded window occupies one character's worth of index space in the text widget, and it may be referred to either by the name of its embedded window or by its position in the widget's index space. If the range of text containing the embedded window is deleted then the window is destroyed.

When an embedded window is added to a text widget with the window create widget command, several configuration options may be associated with it. These options may be modified later with the window configure widget command. The following options are currently supported:

#:align where
If the window is not as tall as the line in which it is displayed, this option determines where the window is displayed in the line. Where must have one of the values
top
align the top of the window with the top of the line
center
center the window within the range of the line
bottom
align the bottom of the window with the bottom of the line's area
baseline
align the bottom of the window with the baseline of the line
#:padx pixels
Pixels specifies the amount of extra space to leave on each side of the embedded window. It may have any of the usual forms defined for a screen distance.
#:pady pixels
Pixels specifies the amount of extra space to leave on the top and on the bottom of the embedded window. It may have any of the usual forms defined for a screen distance.
#:stretch boolean
If the requested height of the embedded window is less than the height of the line in which it is displayed, this option can be used to specify whether the window should be stretched vertically to fill its line. If the #:pady option has been specified as well, then the requested padding will be retained even if the window is stretched.
#:window #<widget>
Specifies the name of a window to display in the annotation.

© Author | Home | Sitemap