TixIntro3
Introduction to the tix library
Overview
Tix, which stands for Tk Interface Extension, is an extension library for Tcl/Tk. Tix adds many new widgets, image types and other commands that allows you to create compelling Tcl/Tk-based GUI applications.
One advantage of Tix over other Tk widget libraries is many of the Tix standard widgets are implemented in native code. This enhances performance and provides native look-and-feel for your applications.
This version of Tix works with Tcl/Tk version 8.0 or above. If Tix has been installed properly on your system, you can load the package into any Tk script by invoking the command package require Tix After this command has successfully returned, you can start using the functionalities of the Tix library. See the EXAMPLES section below for example scripts that use Tix.
If the "package require Tix" command fails, you probably need to install a new copy of Tix on your system. You can download the latest version of Tix from the web site http://tix.sourceforge.net/.
Standard widgets
Tix includes the following standard widgets which, like their counterparts in Tk, are implemented in native code to achieve high performance and native look-and-feel.
tixGrid-
The
tixGridwidget displays items in a spread-sheet format.
tixHList-
Hierarchical listbox widget. This widget display entries in a tree-like format.
tixInputOnly-
A transparent window that can be used to cover another widget so as to disable mouse input.
tixNBFrame-
The
tixNBFramewidget is used internally by thetixNoteBookwidget to display choices among a set of overlapping pages.
tixTList-
Tabular listbox widget. This widget is similar to the built-in Tk
listboxwidget but provides more flexibility in displaying the list entries.
Mega widgets
Tix provides many new types of mega widgets: these are widgets that are composed of built-in Tk widgets and the Tix standard widgets mentioned above.
tixBalloon-
The
tixBalloonwidget provides context-sensitive on-screen help.
tixButtonBox-
A convenience class for creating a box of
buttonwidgets.
tixCheckList-
A subclass of
tixTreethat presents single- or multiple choices to the user in a tree-like format.
tixComboBox-
A combination of the
listboxandentrywidgets that allows the user to input an item by typing or by selecting from a list of items.
tixControl-
The
tixControlwidget allows the user to adjust a value using arrow buttons.
tixDirList-
A directory selection widget that displays the file system as a cascading list.
tixDirSelectDialog-
A dialog for selecting a directory. This widget is deprecated. Use
tk_chooseDirectoryinstead.
tixDirTree-
A directory selection widget that displays the file system in a tree format.
tixExFileSelectBox-
A widget for selecting a file. This widget is deprecated. Use
tk_getOpenFileinstead.
tixExFileSelectDialog-
A dialog for selecting a file. This widget is deprecated. Use
tk_getOpenFileinstead.
tixFileEntry-
A special entry widget that allows the user to choose a file by typing in its name or by selecting from a file dialog.
tixFileSelectBox-
A widget for selecting a file. This widget is deprecated. Use
tk_getOpenFileinstead.
tixFileSelectDialog-
A dialog for selecting a file. This widget is deprecated. Use
tk_getOpenFileinstead.
tixLabelEntry-
A convenience class for creating an
entrywith an associatedlabelwidget.
tixLabelFrame-
A labelled
framewidget for grouping together a set of related widgets.
tixListNoteBook-
The
tixListNoteBookwidget allows the user to choose from a set of over-lapping pages by selecting from a list box.
tixMeter-
The
tixMeterwidget displays a bar graph to indicate progress.
tixNoteBook-
The
tixNoteBookwidget allows the user to choose from a set of over-lapping pages with a tabbed notebook metaphore.
tixOptionMenu-
The
tixOptionMenuwidget allows the user to choose a value from a pop-up menu.
tixPanedWindow-
The
tixPanedWindowwidgets allows the user to adjust the visible size of severalframewidgets with handle bars.
tixPopupMenu-
The
tixPopupMenuwidget can be used to implement context-sensitive pop-up menu.
tixScrolledHList-
A
tixHListwidget with smart scrollbars. Like other Tix scrolled widgets, the scroll bars can be displayed on an as-needed basis.
tixScrolledListBox-
A Tk
listboxwidget with smart scrollbars.
tixScrolledText-
A Tk
textwidget with smart scrollbars.
tixScrolledWindow-
A Tk
framewidget with smart scrollbars.
tixSelect-
The
tixSelectwidget uses a set of buttons to present single- or multiple selection options to the user.
tixStdButtonBox-
A subclass of
tixButtonBoxthat provides four standard buttons (OK, Apply, Cancel Help) for Motif(TM)-like dialog boxes.
tixTree-
A subclass of
tixScrolledHListthat supports expanding and collapsing of entries in a hierarchical list.
Display items
Three Tix standard widgets tixGrid, tixHList and tixTList support the Display Items mechanism. Display items are created by the widget command of these standard widgets. You can customize the items using styles objects.
tixDisplayStyle-
Create style objects to customize display items.
Image types
Tix provides two additional image types to the Tk image framework.
compound-
The
compoundimage type allows you to combine images, widgets, and text strings into a single Tkimageobject.
pixmap-
The
pixmapimage type supports the XPM format.
Other commands
The following Tcl command are also included in the Tix library to perform various functions.
tixDestroy-
Destroy Tix objects instances of classes defined by
tixClassconstruct.
tixForm-
A geometry manager based on attachment rules. This geometry manager is deprecated. Use the Tk
gridgeometry manager instead.
tixMwm-
A command to communicate with the Mwm, the Motif(TM) Window Manager. Works on Unix only.
tix-
The
tixcommand controls the Tix application context.
tixGetBoolean-
The
tixGetBooleancommand converts a string to a boolean value.
tixGetInt-
The
tixGetIntcommand converts a string to a integer value.
tixUtils-
The
tixUtilsmanual page describes some utility Tix commands.
Executable program
tixwish-
The
tixwishprogram can be used to execute Tix-based applications.tixwishis deprecated. You shuld use the standard wish program from Tk and access Tix via the "package require Tix" command.
Examples
The following is an example script that uses a tixTree widget.
set tree [tixTree .t] pack $tree -expand yes -fill both for {set i 0} {$i < 2} {incr i} {
$tree subwidget hlist add $i -itemtype imagetext \
-text "Folder $i" -image [tix getimage folder]
for {set j 0} {$j < 5} {incr j} {
$tree subwidget hlist add $i.$j -itemtype imagetext \
-text "File $i.$j" -image [tix getimage textfile]
} } $tree autosetmode
Keywords
Tix, mega widgets
Releases
8 releases since Debian 6.0 (Squeeze); the text changed 1 time.