1iwidgets::selectionbox  −  Create  and manipulate a selection box
2widget iwidgets::selectionbox pathName ?options?  itk::Widget  <‐
3iwidgets::Selectionbox

activeBackground background borderWidth cursor

exportSelection foreground highlightColor highlightThickness

insertBackground insertBorderWidth insertOffTime insertOnTime

insertWidth relief repeatDelay repeatInterval

selectBackground selectBorderWidth selectForeground

9See  the  "options"  manual entry for details on the standard op‐
10tions.

textBackground textFont

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

labelFont labelMargin

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

activeRelief elementBorderWidth jumptroughColor

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

dblClickCommand hscrollMode sbWidth scrollMargin

textBackground textFont vscrollMode

22See  the  "scrolledlistbox" widget class manual entry for details
23on the above associated options.
24
25Name:           childSitePos
26Class:          Position
27Command‐Line Switch:           ‐childsitepos
28Specifies the position of the child site in the selection box: n,

s, e, w, or . The default is center

30Name:           height
31Class:          Height
32Command‐Line Switch:           ‐height
33Specifies  the  height  of  the  selection box.  The value may be
34specified in any of the forms acceptable  to  Tk_GetPixels.   The
35default is 320 pixels.
36Name:           itemsCommand
37Class:          Command
38Command‐Line Switch:           ‐itemscommand
39Specifies  a  command  to  be evaluated following selection of an
40item.
41Name:           itemsLabel
42Class:          Text
43Command‐Line Switch:           ‐itemslabel
44Specifies the text of the label for the items list.  The  default
45is "List".
46Name:           itemsLabelPos
47Class:          Position
48Command‐Line Switch:           ‐itemslabelpos
49Specifies  the  position of the label along the side of the items
50list: n, ne, e, se, s, sw, w, or nw.  The default is nw.
51Name:           itemsOn
52Class:          ItemsOn
53Command‐Line Switch:           ‐itemson
54Specifies whether or not to display the items list in any of  the
55forms acceptable to Tcl_GetBoolean.  The default is true.
56Name:           margin
57Class:          Margin
58Command‐Line Switch:           ‐margin
59Specifies  distance between the items list and selection entry in
60any of the forms acceptable to Tk_GetPixels.  The  default  is  7
61pixels.
62Name:           selectionCommand
63Class:          Command
64Command‐Line Switch:           ‐selectioncommand
65Specifies  a  Tcl  procedure  to  be associated with a return key
66press event in the selection entry field.
67Name:           selectionLabel
68Class:          Text
69Command‐Line Switch:           ‐selectionlabel
70Specifies the text of the label for the  selection  entry  field.
71The default is "Selection".
72Name:           selectionLabelPos
73Class:          Position
74Command‐Line Switch:           ‐selectionlabelpos
75Specifies  the position of the label along the side of the selec‐
76tion: n, ne, e, se, s, sw, w, or nw.  The default is nw.
77Name:           selectionOn
78Class:          SelectionOn
79Command‐Line Switch:           ‐selectionon
80Specifies whether or not to display the selection entry in any of
81the forms acceptable to Tcl_GetBoolean.  The default is true.
82Name:           width
83Class:          Width
84Command‐Line Switch:           ‐width
85Specifies the width of the selection box.  The value may be spec‐
86ified in any of the forms acceptable to  Tk_GetPixels.   The  de‐
87fault is 260 pixels.
88
89The  iwidgets::selectionbox  command  creates  a scrolled list of
90items and a selection entry field.  The user may  choose  any  of
91the  items displayed in the scrolled list of alternatives and the
92selection field will be filled with the choice.  The user is also
93free to enter a new value in the selection entry field.  Both the
94list and entry areas have labels.  A child site is also  provided
95in which the user may create other widgets to be used in conjunc‐
96tion with the selection box.
97
98The iwidgets::selectionbox command  creates  a  new  Tcl  command
99whose name is pathName.  This command may be used to invoke vari‐
100ous operations on the widget.  It has the following general form:

pathName option ?arg arg ...? Option and the args determine the

102exact behavior of the command.
103

curselection delete index nearest

scan selection size

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

pathName cget option Returns the current value of the configura‐

110tion option given by option.  Option may have any of  the  values
111accepted  by the iwidgets::selectionbox command.  pathName child‐

site Returns the child site widget path name. pathName clear

component Delete the contents of either the selection entry wid‐

114get or items list.  The component argument may be either items or

selection. pathName configure ?option? ?value option value ...?

116Query or modify the configuration options of the widget.   If  no

option is specified, returns a list describing all of the avail‐

118able options for pathName (see Tk_ConfigureInfo  for  information
119on the format of this list).  If option is specified with no val‐

ue, then the command returns a list describing the one named op‐

121tion (this list will be identical to the corresponding sublist of
122the value returned if no option is specified).  If  one  or  more

option−value pairs are specified, then the command modifies the

124given widget option(s) to have the given value(s);  in this  case
125the  command returns an empty string.  Option may have any of the
126values accepted by the iwidgets::selectionbox command.   pathName

get Returns the current value of the selection entry widget.

pathName insert component args Insert element(s) into either the

129selection entry widget or items list.  The component argument may
130be either items or selection.  The args follow the rules  of  ei‐
131ther  an  entry  or list widget depending on the component value.

pathName selectitem Replace the selection entry field contents

133with the currently selected items value.
134
135Name:           childsite
136Class:          Frame
137The  childsite component is the user child site for the selection
138box.  See the "frame" widget manual  entry  for  details  on  the
139childsite component item.
140Name:           items
141Class:          Scrolledlistbox
142The  items  component provides the scrolled list box of items for
143the selection box.  See the "scrolledlistbox" widget manual entry
144for details on the items component item.
145Name:           selection
146Class:          Entryfield
147The selection component provides the entry field in the selection
148box for display of the selected item in the items component.  See
149the "entryfield" widget manual entry for details on the selection
150component item.
151
152 package require Iwidgets 4.0
153 option add *textBackground white
154
155 iwidgets::selectionbox .sb ‐items {Hello {Out There} World}
156 pack .sb ‐padx 10 ‐pady 10 ‐fill both ‐expand yes
157
158 set cs [label [.sb childsite].label ‐text "Child Site"]
159 pack $cs ‐fill x ‐padx 10 ‐pady 10
160
161 .sb insert items 2 {Cruel Cruel}
162
163 .sb selection set 1 Mark L. Ulferts selectionbox, widget
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
Impressum