Tix adds five new standard widgets to Tk: tixGrid, tixHList, tixInputOnly, tixNote-BookFrame, and tixTList. These widgets add new features to Tk that could not be constructed from the standard Tk widgets.
Three of the standard widgets added to Tk by Tix are designed to arrange and display items in a list or grid without regard to how each item is actually drawn. They simply treat the items as rectangular boxes and leave the drawing part to the item itself. To this end, all three widgets, called host widgets, support a set of items with a common interface, called display items.
Tix currently has four types of display items:
image
, text
,
imagetext
, and window
. A C API
exists for the programmer to add more item types. The appearance of
each item is controlled by option-value pairs specified at creation in
a manner similar to how items of the canvas widget are configured.
Each host widget also supports an entryconfigure
method for changing options for existing items.
Since several or all items in a host widget will share common display attributes, Tix supports the concept of display styles. Each display item supports the -style option, which accepts as a value a display style as Returned by the tixDisplayStyle command. The tixDisplayStyle command is described in detail in the "Tix Core Commands" section, later in this chapter. In short, it defines a style by defining values for a subset of the style options a display item type supports. Display items are configured to use the style using the -style option. Changes to the style at a later time will be reflected in all display items connected to the style.
Display items of the type image
are used to
display Tk images. Image items support the following
options:
imageName
(image
,
Image
)Image to display in the item.
displayStyle
(imageStyle
,
ImageStyle
)Display style to which to connect the item.
Image items support the following standard widget options as style options:
-activebackground | -activeforeground | -anchor |
-background | -disabledbackground | -disabledforeground |
-foreground | -padx | -pady |
-selectbackground | -selectforeground |
Display items of the type imagetext
are
used to display an image and a text string together. Imagetext items
support the following options:
bitmap
(bitmap
,
Bitmap
)Bitmap to display in the item.
imageName
(image
,
Image
)Image to display in the item. Overrides the -bitmap option.
displayStyle
(imageTextStyle
,
ImageTextStyle
)Display style to which to connect the item.
boolean
(showImage
,
ShowImage
)Whether image/bitmap should be displayed.
boolean
(showText
,
ShowText
)Whether text string should be displayed.
string
(text
,
Text
)Text string to display in the item.
string
(underline
,
Underline
)Text string to display in the item.
Imagetext items support the following standard widget options as style options:
-activebackground | -activeforeground | -anchor |
-background | -disabledbackground | -disabledforeground |
-font | -foreground | -justify |
-padx | -pady | -selectbackground |
-selectforeground | -wraplength |
Imagetext items support the following special style option:
amount
(gap
,
Gap
)Distance in pixels between the bitmap/image and the text string.
Display items of the type text are used to display a simple text string. Text items support the following options:
displayStyle
(textStyle
,
TextStyle
)Display style to which to connect the item.
string
(text
,
Text
)Text string to display in the item.
string
(underline
,
Underline
)Text string to display in the item.
Text items support the following standard widget options as style options:
-activebackground | -activeforeground | -anchor |
-background | -disabledbackground | -disabledforeground |
-font | -foreground | -justify |
-padx | -pady | -selectbackground |
-selectforeground | -wraplength |
Display items of the type window
are used
to display a subwindow in a host widget. Window items support the
following options:
displayStyle
(windowStyle
,
WindowStyle
)Display style to which to connect the item.
pathName
(window
,
Window
)pathName of widget to display as a subwindow in the item.
Window items support the following standard widget options as style options:
-anchor | -padx | -pady |