selectionbox - Create and manipulate a selection box widget

SYNOPSIS

selectionbox pathName ?options?

INHERITANCE

itk::Widget <- selectionbox

STANDARD OPTIONS

activeBackground
exportSelection
insertBackground
insertWidth
selectBackground
background
foreground
insertBorderWidth
relief
selectBorderWidth
borderWidth
highlightColor
insertOffTime
repeatDelay
selectForeground
cursor
highlightThickness
insertOnTime
repeatInterval

See the "options" manual entry for details on the standard options.

ASSOCIATED OPTIONS

textBackground
textFont

See the "entryfield" widget class manual entry for details on the above associated options.

labelFont
labelMargin

See the "labeledwidget" class manual entry for details on the above associated options.

activeRelief
elementBorderWidth
jump
troughColor

See the "scrollbar" widget class manual entry for details on the above associated options.

dblClickCommand
textBackground
hscrollMode
textFont
sbWidth
vscrollMode
scrollMargin

See the "scrolledlistbox" widget class manual entry for details on the above associated options.

WIDGET-SPECIFIC OPTIONS

Name:                   childSitePos
Class:                  Position
Command-Line Switch:	-childsitepos

Name:                   height
Class:                  Height
Command-Line Switch:	-height

Name:                   itemsCommand
Class:                  Command
Command-Line Switch:	-itemscommand

Name:                   itemsLabel
Class:                  Text
Command-Line Switch:	-itemslabel

Name:                   itemsLabelPos
Class:                  Position
Command-Line Switch:	-itemslabelpos

Name:                   itemsOn
Class:                  ItemsOn
Command-Line Switch:	-itemson

Name:                   margin
Class:                  Margin
Command-Line Switch:	-margin

Name:                   selectionCommand
Class:                  Command
Command-Line Switch:	-selectioncommand

Name:                   selectionLabel
Class:                  Text
Command-Line Switch:	-selectionlabel

Name:                   selectionLabelPos
Class:                  Position
Command-Line Switch:	-selectionlabelpos

Name:                   selectionOn
Class:                  SelectionOn
Command-Line Switch:	-selectionon

Name:                   width
Class:                  Width
Command-Line Switch:	-width


DESCRIPTION

The selectionbox command creates a scrolled list of items and a selection entry field. The user may choose any of the items displayed in the scrolled list of alternatives and the selection field will be filled with the choice. The user is also free to enter a new value in the selection entry field. Both the list and entry areas have labels. A child site is also provided in which the user may create other widgets to be used in conjunction with the selection box.

METHODS

The selectionbox command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:

pathName option ?arg arg ...?
Option and the args determine the exact behavior of the command.

ASSOCIATED METHODS

curselection
scan
delete
selection
index
size
nearest

See the "listbox" widget class manual entry for details on the associated methods.

WIDGET-SPECIFIC METHODS

pathName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the selectionbox command.
pathName childsite
Returns the child site widget path name.
pathName clear component
Delete the contents of either the selection entry widget or items list. The component argument may be either items or selection.
pathName configure ?option? ?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_ConfigureInfo for information on the format of this list). If option 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 selectionbox command.
pathName get
Returns the current value of the selection entry widget.
pathName insert component args
Insert element(s) into either the selection entry widget or items list. The component argument may be either items or selection. The args follow the rules of either an entry or list widget depending on the component value.
pathName selectitem
Replace the selection entry field contents with the currently selected items value.

COMPONENTS

Name:                   childsite
Class:                  Frame

Name:                   items
Class:                  Scrolledlistbox

Name:                   selection
Class:                  Entryfield

EXAMPLE

 option add *textBackground white

 selectionbox .sb -items {Hello {Out There} World}
 pack .sb -padx 10 -pady 10 -fill both -expand yes 

 set cs [label [.sb childsite].label -text "Child Site"]
 pack $cs -fill x -padx 10 -pady 10

 .sb insert items 2 {Cruel Cruel}

 .sb selection set 1

AUTHOR

Mark L. Ulferts

KEYWORDS

selectionbox, widget