# Copyright (c) 1996, Expert Interface Technologies # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # The file man.macros and some of the macros used by this file are # copyrighted: (c) 1990 The Regents of the University of California. # (c) 1994-1995 Sun Microsystems, Inc. # The license terms of the Tcl/Tk distribution are in the file # license.tcl. =head1 NAME Tk::TList - Create and manipulate Tix Tabular List widgets =for category Tix Extensions =head1 SYNOPSIS S< >I<$tlist> = I<$parent>-EB(?I?); =head1 SUPER-CLASS None. =head1 STANDARD OPTIONS B<-background> B<-borderwidth> B<-class> B<-cursor> B<-foreground> B<-font> B<-height> B<-highlightcolor> B<-highlightthickness> B<-relief> B<-selectbackground> B<-selectforeground> B<-xscrollcommand> B<-yscrollcommand> B<-width> See L for details of the standard options. =head1 WIDGET-SPECIFIC OPTIONS =over 4 =item Name: B =item Class: B =item Switch: B<-browsecmd> Specifies a perl/Tk B to be executed when the user browses through the entries in the TList widget. =item Name: B =item Class: B =item Switch: B<-command> Specifies the perl/Tk B to be executed when the user invokes a list entry in the TList widget. Normally the user invokes a list entry by double-clicking it or pressing the Return key. =item Name: B =item Class: B =item Switch: B<-foreground> =item Alias: B<-fg> Specifies the default foreground color for the list entries. =item Name: B =item Class: B =item Switch: B<-height> Specifies the desired height for the window in number of characters. =item Name: B =item Class: B =item Switch: B<-itemtype> Specifies the default type of display item for this TList widget. When you call the B methods, display items of this type will be created if the B<-itemtype> option is not specified. =item Name: B =item Class: B =item Switch: B<-orient> Specifies the order of tabularizing the list entries. When set to "B", the entries are arranged in a column, from top to bottom. If the entries cannot be contained in one column, the remaining entries will go to the next column, and so on. When set to "B", the entries are arranged in a row, from left to right. If the entries cannot be contained in one row, the remaining entries will go to the next row, and so on. =item Name: B =item Class: B =item Switch: B<-padx> The default horizontal padding for list entries. =item Name: B =item Class: B =item Switch: B<-padx> The default vertical padding for list entries. =item Name: B =item Class: B =item Switch: B<-selectbackground> Specifies the background color for the selected list entries. =item Name: B =item Class: B =item Switch: B<-selectborderwidth> Specifies a non-negative value indicating the width of the 3-D border to draw around selected items. The value may have any of the forms acceptable to B. =item Name: B =item Class: B =item Switch: B<-selectforeground> Specifies the foreground color for the selected list entries. =item Name: B =item Class: B =item Switch: B<-selectmode> Specifies one of several styles for manipulating the selection. The value of the option may be arbitrary, but the default bindings expect it to be either B, B, B, or B; the default value is B. =item Name: B =item Class: B =item Switch: B<-sizecmd> Specifies a perl/Tk B to be called whenever the TList widget changes its size. This command can be useful to implement "user scroll bars when needed" features. =item Name: B =item Class: B =item Switch: B<-state> Specifies whether the TList command should react to user actions. When set to "B", the TList reacts to user actions in the normal way. When set to "B", the TList can only be scrolled, but its entries cannot be selected or activated. =item Name: B =item Class: B =item Switch: B<-width> Specifies the desired width for the window in characters. =back =head1 DESCRIPTION The B method creates a new window (given by the $widget argument) and makes it into a TList widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the TList widget such as its cursor and relief. The TList widget can be used to display data in a tabular format. The list entries of a TList widget are similar to the entries in the Tk listbox widget. The main differences are (1) the TList widget can display the list entries in a two dimensional format and (2) you can use graphical images as well as multiple colors and fonts for the list entries. Each list entry is identified by an B, which can be in the following forms: =over 4 =item I An integer that indicates the position of the entry in the list. 0 means the first position, 1 means the second position, and so on. =item B Indicates the end of the listbox. For some commands this means just after the last entry; for other commands it means the last entry. =item B<@>I,I Indicates the element that covers the point in the listbox window specified by x and y (in pixel coordinates). If no element covers that point, then the closest element to that point is used. =back =head1 DISPLAY ITEMS Each list entry in an TList widget is associated with a B item. The display item determines what visual information should be displayed for this list entry. Please see L for a list of all display items. When a list entry is created by the B command, the type of its display item is determined by the B<-itemtype> option passed to these commands. If the B<-itemtype> is omitted, then by default the type specified by this TList widget's B<-itemtype> option is used. =head1 WIDGET METHODS The B method creates a widget object. This object supports the B and B methods described in L which can be used to enquire and modify the options described above. The widget also inherits all the methods provided by the generic L class. The following additional methods are available for TList widgets: =over 4 =item I<$tlist>-EB(I) Sets the anchor to the list entry identified by I. The anchor is the end of the selection that is fixed while dragging out a selection with the mouse. =item I<$tlist>-EB Removes the anchor, if any, from this TList widget. This only removes the surrounding highlights of the anchor entry and does not affect its selection status. =item I<$tlist>-EB(I?I?) Deletes one or more list entries between the two entries specified by the indices I and I. If I is not specified, deletes the single entry specified by I. =item I<$tlist>-EB(I) Sets the dragsite to the list entry identified by I. The dragsite is used to indicate the source of a drag-and-drop action. Currently drag-and-drop functionality has not been implemented in Tix yet. =item I<$tlist>-EB Remove the dragsite, if any, from the this TList widget. This only removes the surrounding highlights of the dragsite entry and does not affect its selection status. =item I<$tlist>-EB(I) Sets the dropsite to the list entry identified by I. The dropsite is used to indicate the target of a drag-and-drop action. Currently drag-and-drop functionality has not been implemented in Tix yet. =item I<$tlist>-EB Remove the dropsite, if any, from the this TList widget. This only removes the surrounding highlights of the dropsite entry and does not affect its selection status. =item I<$tlist>-EB(I) Returns the current value of the configuration option given by I