NAME
iwidgets::selectionbox - Create and manipulate a selection box widget
SYNOPSIS
iiwwiiddggeettss::::sseelleeccttiioonnbbooxx pathName ?options? IINNHHEERRIITTAANNCCEEitk::Widget <- iwidgets::Selectionbox
SSTTAANNDDAARRDD OOPPTTIIOONNSS aaccttiivveeBBaacckkggrroouunndd bbaacckkggrroouunndd bboorrddeerrWWiiddtthh ccuurrssoorr eexxppoorrttSSeelleeccttiioonn ffoorreeggrroouunndd hhiigghhlliigghhttCCoolloorr hhiigghhlliigghhttTThhiicckknneessss iinnsseerrttBBaacckkggrroouunndd iinnsseerrttBBoorrddeerrWWiiddtthh iinnsseerrttOOffffTTiimmee iinnsseerrttOOnnTTiimmee iinnsseerrttWWiiddtthh rreelliieeff rreeppeeaattDDeellaayy rreeppeeaattIInntteerrvvaall sseelleeccttBBaacckkggrroouunndd sseelleeccttBBoorrddeerrWWiiddtthh sseelleeccttFFoorreeggrroouunndd See the "options" manual entry for details on the standard options. AASSSSOOCCIIAATTEEDD OOPPTTIIOONNSS tteexxttBBaacckkggrroouunndd tteexxttFFoonntt See the "entryfield" widget class manual entry for details on the above associated options. llaabbeellFFoonntt llaabbeellMMaarrggiinn See the "labeledwidget" class manual entry for details on the above associated options. aaccttiivveeRReelliieeff eelleemmeennttBBoorrddeerrWWiiddtthh jjuummppttrroouugghhCCoolloorr See the "scrollbar" widget class manual entry for details on the above associated options. ddbbllCClliicckkCCoommmmaanndd hhssccrroollllMMooddee ssbbWWiiddtthh ssccrroollllMMaarrggiinn tteexxttBBaacckkggrroouunndd tteexxttFFoonntt vvssccrroollllMMooddee See the "scrolledlistbox" widget class manual entry for details on the above associated options.WWIIDDGGEETT-SSPPEECCIIFFIICC OOPPTTIIOONNSS
Name: cchhiillddSSiitteePPooss Class: PPoossiittiioonnCommand-Line Switch: -cchhiillddssiitteeppooss
Specifies the position of the child site in the selection box: nn, ss, ee, ww, or . The default is center Name: hheeiigghhtt Class: HHeeiigghhttCommand-Line Switch: -hheeiigghhtt
Specifies the height of the selection box. The value may be specified in any of the forms acceptable to TkGetPixels. The default is 320 pixels. Name: iitteemmssCCoommmmaanndd Class: CCoommmmaannddCommand-Line Switch: -iitteemmssccoommmmaanndd
Specifies a command to be evaluated following selection of an item. Name: iitteemmssLLaabbeell Class: TTeexxttCommand-Line Switch: -iitteemmssllaabbeell
Specifies the text of the label for the items list. The default is "List". Name: iitteemmssLLaabbeellPPooss Class: PPoossiittiioonnCommand-Line Switch: -iitteemmssllaabbeellppooss
Specifies the position of the label along the side of the items list: nn, nnee, ee, ssee, ss, ssww, ww, or nnww. The default is nw. Name: iitteemmssOOnn Class: IItteemmssOOnnCommand-Line Switch: -iitteemmssoonn
Specifies whether or not to display the items list in any of the forms acceptable to TTccllGGeettBBoooolleeaann. The default is true. Name: mmaarrggiinn Class: MMaarrggiinnCommand-Line Switch: -mmaarrggiinn
Specifies distance between the items list and selection entry in any of the forms acceptable to TTkkGGeettPPiixxeellss. The default is 7 pixels. Name: sseelleeccttiioonnCCoommmmaanndd Class: CCoommmmaannddCommand-Line Switch: -sseelleeccttiioonnccoommmmaanndd
Specifies a Tcl procedure to be associated with a return key press event in the selection entry field. Name: sseelleeccttiioonnLLaabbeell Class: TTeexxttCommand-Line Switch: -sseelleeccttiioonnllaabbeell
Specifies the text of the label for the selection entry field. The default is "Selection". Name: sseelleeccttiioonnLLaabbeellPPooss Class: PPoossiittiioonnCommand-Line Switch: -sseelleeccttiioonnllaabbeellppooss
Specifies the position of the label along the side of the selec-
tion: nn, nnee, ee, ssee, ss, ssww, ww, or nnww. The default is nw. Name: sseelleeccttiioonnOOnn Class: SSeelleeccttiioonnOOnnCommand-Line Switch: -sseelleeccttiioonnoonn
Specifies whether or not to display the selection entry in any of the forms acceptable to TTccllGGeettBBoooolleeaann. The default is true. Name: wwiiddtthh Class: WWiiddtthhCommand-Line Switch: -wwiiddtthh
Specifies the width of the selection box. The value may be specified in any of the forms acceptable to TkGetPixels. The default is 260 pixels.DESCRIPTION
The iiwwiiddggeettss::::sseelleeccttiioonnbbooxx command creates a scrolled list of items anda selection entry field. The user may choose any of the items dis-
played 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. MMEETTHHOODDSS The iiwwiiddggeettss::::sseelleeccttiioonnbbooxx 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. AASSSSOOCCIIAATTEEDD MMEETTHHOODDSS ccuurrsseelleeccttiioonn ddeelleettee iinnddeexx nneeaarreesstt ssccaann sseelleeccttiioonn ssiizzeeSee the "listbox" widget class manual entry for details on the associ-
ated methods.WWIIDDGGEETT-SSPPEECCIIFFIICC MMEETTHHOODDSS
pathName ccggeett option Returns the current value of the configuration option given byoption. Option may have any of the values accepted by the iiwwiidd-
ggeettss::::sseelleeccttiioonnbbooxx command. pathName cchhiillddssiittee Returns the child site widget path name. pathName cclleeaarr component Delete the contents of either the selection entry widget or items list. The component argument may be either iitteemmss or sseelleeccttiioonn. pathName ccoonnffiigguurree ?option? ?value option value ...? Query or modify the configuration options of the widget. If nooption is specified, returns a list describing all of the avail-
able options for pathName (see TTkkCCoonnffiigguurreeIInnffoo 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 ormore 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 iiwwiiddggeettss::::sseelleeccttiioonnbbooxx command. pathName ggeett Returns the current value of the selection entry widget. pathName iinnsseerrtt component args Insert element(s) into either the selection entry widget or items list. The component argument may be either iitteemmss or sseelleeccttiioonn. The args follow the rules of either an entry or list widget depending on the component value. pathName sseelleeccttiitteemm Replace the selection entry field contents with the currently selected items value. CCOOMMPPOONNEENNTTSS Name: cchhiillddssiittee Class: FFrraammee The childsite component is the user child site for the selection box. See the "frame" widget manual entry for details on the childsite component item. Name: iitteemmss Class: SSccrroolllleeddlliissttbbooxx The items component provides the scrolled list box of items for the selection box. See the "scrolledlistbox" widget manual entry for details on the items component item. Name: sseelleeccttiioonn Class: EEnnttrryyffiieellddThe selection component provides the entry field in the selec-
tion box for display of the selected item in the items compo-
nent. See the "entryfield" widget manual entry for details on the selection component item. EEXXAAMMPPLLEE package require Iwidgets 4.0 option add *textBackground whiteiwidgets::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 KKEEYYWWOORRDDSS selectionbox, widget Tk iwidgets::selectionbox(1)