Tix Standard Widgets Overview

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.

Display Items

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 ...

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.