ActiveTcl User Guide
|
||
box widgets iwidgets::scrolledlistbox pathName ?options? itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Scrolledwid- get <- iwidgets::Scrolledlistbox
activeBackground background borderWidth cursor exportSelection foreground highlightColor highlightThickness
tions.
associated options.
activeRelief elementBorderwidth
jumptroughColor
associated options.
herited options.
double clicked. Typically this occurs when mouse button 1 is double clicked over an item. Selection policy does not matter.
components such as labels, margins, and scrollbars force the listbox to be compressed. A value of zero along with the same value for the width causes the value given for the visibleitems option to be applied which administers geometry constraints in a different manner. The default height is zero.
scrollbar: static, dynamic, or none. In
static mode, the scroll bar is displayed at all times. Dynamic mode
displays the scroll bar as required, and none disables the scroll
bar display. The default is static.
able to Tk_GetPixels. The default width is 15 pixels..
of the forms acceptable to Tk_GetPixels. The default is 3
pix- els.
selected. Selection policy does not matter.
fault is normal.
background within the listbox to be different from the normal
background color.
lows for the font associated with text internal to the scrolled listbox to be different than the font for labels.
box. This option is only administered if the width and height options are both set to zero, otherwise they take precedence.
gaged, geometry constraints are maintained only on the listbox.
scroll bars, are additive and independent, effecting the overall
size of the scrolled list box. In contrast, should the width and
height options have non zero values, they are applied to the
scrolled list box as a whole. The listbox is compressed or ex-
panded to maintain the geometry constraints.
scrollbar: static, dynamic, or none. In
static mode, the scroll bar is displayed at all times. Dynamic mode
displays the scroll bar as required, and none disables the scroll
bar display. The default is static.
components such as labels, margins, and scrollbars force the listbox to be compressed. A value of zero along with the same value for the height causes the value given for the visibleitems option to be applied which administers geometry constraints in a different manner. The default width is zero. _________________________________________________________________
with additional options to manage horizontal and vertical scroll- bars. This includes options to control which scrollbars are dis- played and the method, i.e. statically or dynamically.
whose name is pathName. This command may be used to invoke vari- ous operations on the widget. It has the following general form:
pathName option ?arg arg ...?
gument an indicator of which entry of the list box to operate on.
of the following forms: number Specifies the element as a numeri- cal index, where 0 corresponds to the first element in the list- box. active Indicates the element that has the location cursor.
has the keyboard focus, and it is specified with the activate widget command. anchor Indicates the anchor point for the selec- tion, which is set with the selection anchor widget command. end
just after the last element; for other commands it means the last element. @x,y 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. pattern If the index doesn't satisfy one of the above forms then this form is used. Pattern is pattern-matched against the items in the list box, in order from the top down, until a matching entry is found. The rules of Tcl_StringMatch are used. The following widget commands are possible for scrolledlistbox widgets:
activate bbox curselection delete
methods.
pathName cget option Returns the current value of the configura- tion option given by option. Option may have any of the values accepted by the iwidgets::scrolledlistbox command. pathName clear Clears the listbox of all items. pathName configure ?op- tion? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_Con*- figureInfo for information on the format of this list). If op- tion is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the iwid*- gets::scrolledlistbox command. pathName getcurselection Returns the contents of the listbox element indicated by the current se- lection indexes. Short cut version of get and curselection com- mand combination. pathName justify direction Justifies the list contents via teh scroll bars in one of four directions: left, right, top, or bottom. pathName selecteditemcount Returns the number of items currently selected in the list. pathName sort order Sort the current list in any of the forms accepted by Tcl's lsort command. Also accepts either ascending or descending or- der.
widget manual entry for details on the listbox component item.
scrollbar widget manual entry for details on the horizsb compo-
nent item.
scrollbar widget manual entry for details on the vertsb compo- nent item.
package require Iwidgets 4.0
option add *textBackground white
proc selCmd {} {
puts stdout [.slb getcurselection]"
}
proc defCmd {} {
puts stdout Double Click"
return [selCmd]
}
iwidgets::scrolledlistbox .slb -selection single \ -vscrollmode
static -hscrollmode dynamic -labeltext List \ -selectioncommand
selCmd -dblclickcommand defCmd pack .slb -padx 10 -pady 10 -fill
both -expand yes .slb insert end {Hello {Out There} World}