1
2@c %start of fragment
3
4@deftp Class <gtk-combo-box>
5Derives from @code{<gtk-cell-layout>}, @code{<gtk-cell-editable>},
6@code{<gtk-bin>}.
7
8This class defines the following slots:
9
10@table @code
11@item model
12The model for the combo box
13
14@item wrap-width
15Wrap width for laying out the items in a grid
16
17@item row-span-column
18TreeModel column containing the row span values
19
20@item column-span-column
21TreeModel column containing the column span values
22
23@item active
24The item which is currently active
25
26@item add-tearoffs
27Whether dropdowns should have a tearoff menu item
28
29@item tearoff-title
30A title that may be displayed by the window manager when the popup is torn-off
31
32@item has-frame
33Whether the combo box draws a frame around the child
34
35@item focus-on-click
36Whether the combo box grabs focus when it is clicked with the mouse
37
38@item popup-shown
39Whether the combo's dropdown is shown
40
41@end table
42
43@end deftp
44
45@defop Signal <gtk-combo-box> changed
46The changed signal is emitted when the active item is changed. The can be due to
47the user selecting a different item from the list, or due to a call to
48@code{gtk-combo-box-set-active-iter}. It will also be emitted while typing into
49a GtkComboBoxEntry, as well as when selecting an item from the
50GtkComboBoxEntry's list.
51
52Since 2.4
53
54@end defop
55
56@defop Signal <gtk-combo-box> move-active  (arg0@tie{}@code{<gtk-scroll-type>})
57undocumented
58@end defop
59
60@defop Signal <gtk-combo-box> popup
61undocumented
62@end defop
63
64@defop Signal <gtk-combo-box> popdown  @result{}@tie{}@code{<gboolean>}
65undocumented
66@end defop
67
68@deffn Function gtk-combo-box-new  @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
69Creates a new empty @code{<gtk-combo-box>}.
70
71@table @var
72@item ret
73A new @code{<gtk-combo-box>}.
74
75@end table
76
77Since 2.4
78
79@end deffn
80
81@deffn Function gtk-combo-box-new-with-model  (model@tie{}@code{<gtk-tree-model>}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
82Creates a new @code{<gtk-combo-box>} with the model initialized to @var{model}.
83
84@table @var
85@item model
86A @code{<gtk-tree-model>}.
87
88@item ret
89A new @code{<gtk-combo-box>}.
90
91@end table
92
93Since 2.4
94
95@end deffn
96
97@deffn Function gtk-combo-box-get-wrap-width  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{int})
98@deffnx Method get-wrap-width
99Returns the wrap width which is used to determine the number of columns for the
100popup menu. If the wrap width is larger than 1, the combo box is in table mode.
101
102@table @var
103@item combo-box
104A @code{<gtk-combo-box>}.
105
106@item ret
107the wrap width.
108
109@end table
110
111Since 2.6
112
113@end deffn
114
115@deffn Function gtk-combo-box-set-wrap-width  (self@tie{}@code{<gtk-combo-box>}) (width@tie{}@code{int})
116@deffnx Method set-wrap-width
117Sets the wrap width of @var{combo-box} to be @var{width}. The wrap width is
118basically the preferred number of columns when you want the popup to be layed
119out in a table.
120
121@table @var
122@item combo-box
123A @code{<gtk-combo-box>}.
124
125@item width
126Preferred number of columns.
127
128@end table
129
130Since 2.4
131
132@end deffn
133
134@deffn Function gtk-combo-box-get-row-span-column  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{int})
135@deffnx Method get-row-span-column
136Returns the column with row span information for @var{combo-box}.
137
138@table @var
139@item combo-box
140A @code{<gtk-combo-box>}.
141
142@item ret
143the row span column.
144
145@end table
146
147Since 2.6
148
149@end deffn
150
151@deffn Function gtk-combo-box-set-row-span-column  (self@tie{}@code{<gtk-combo-box>}) (row_span@tie{}@code{int})
152@deffnx Method set-row-span-column
153Sets the column with row span information for @var{combo-box} to be
154@var{row-span}. The row span column contains integers which indicate how many
155rows an item should span.
156
157@table @var
158@item combo-box
159A @code{<gtk-combo-box>}.
160
161@item row-span
162A column in the model passed during construction.
163
164@end table
165
166Since 2.4
167
168@end deffn
169
170@deffn Function gtk-combo-box-get-active  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{int})
171@deffnx Method get-active
172Returns the index of the currently active item, or -1 if there's no active item.
173If the model is a non-flat treemodel, and the active item is not an immediate
174child of the root of the tree, this function returns
175@samp{gtk_tree_path_get_indices (path)[0]}, where @samp{path} is the
176@code{<gtk-tree-path>} of the active item.
177
178@table @var
179@item combo-box
180A @code{<gtk-combo-box>}.
181
182@item ret
183An integer which is the index of the currently active item, or -1 if there's no
184active item.
185
186@end table
187
188Since 2.4
189
190@end deffn
191
192@deffn Function gtk-combo-box-set-active  (self@tie{}@code{<gtk-combo-box>}) (index_@tie{}@code{int})
193@deffnx Method set-active
194Sets the active item of @var{combo-box} to be the item at @var{index}.
195
196@table @var
197@item combo-box
198A @code{<gtk-combo-box>}.
199
200@item index
201An index in the model passed during construction, or -1 to have no active item.
202
203@end table
204
205Since 2.4
206
207@end deffn
208
209@deffn Function gtk-combo-box-get-active-iter  (self@tie{}@code{<gtk-combo-box>}) (iter@tie{}@code{<gtk-tree-iter>}) @result{}@tie{} (ret@tie{}@code{bool})
210@deffnx Method get-active-iter
211Sets @var{iter} to point to the current active item, if it exists.
212
213@table @var
214@item combo-box
215A @code{<gtk-combo-box>}
216
217@item iter
218The uninitialized @code{<gtk-tree-iter>}.
219
220@item ret
221@samp{@code{#t}}, if @var{iter} was set
222
223@end table
224
225Since 2.4
226
227@end deffn
228
229@deffn Function gtk-combo-box-set-active-iter  (self@tie{}@code{<gtk-combo-box>}) (iter@tie{}@code{<gtk-tree-iter>})
230@deffnx Method set-active-iter
231Sets the current active item to be the one referenced by @var{iter}. @var{iter}
232must correspond to a path of depth one.
233
234@table @var
235@item combo-box
236A @code{<gtk-combo-box>}
237
238@item iter
239The @code{<gtk-tree-iter>}.
240
241@end table
242
243Since 2.4
244
245@end deffn
246
247@deffn Function gtk-combo-box-get-model  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-model>})
248@deffnx Method get-model
249Returns the @code{<gtk-tree-model>} which is acting as data source for
250@var{combo-box}.
251
252@table @var
253@item combo-box
254A @code{<gtk-combo-box>}.
255
256@item ret
257A @code{<gtk-tree-model>} which was passed during construction.
258
259@end table
260
261Since 2.4
262
263@end deffn
264
265@deffn Function gtk-combo-box-set-model  (self@tie{}@code{<gtk-combo-box>}) (model@tie{}@code{<gtk-tree-model>})
266@deffnx Method set-model
267Sets the model used by @var{combo-box} to be @var{model}. Will unset a
268previously set model (if applicable). If model is @samp{@code{#f}}, then it will
269unset the model.
270
271Note that this function does not clear the cell renderers, you have to call
272@code{gtk-combo-box-cell-layout-clear} yourself if you need to set up different
273cell renderers for the new model.
274
275@table @var
276@item combo-box
277A @code{<gtk-combo-box>}.
278
279@item model
280A @code{<gtk-tree-model>}.
281
282@end table
283
284Since 2.4
285
286@end deffn
287
288@deffn Function gtk-combo-box-new-text  @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
289Convenience function which constructs a new text combo box, which is a
290@code{<gtk-combo-box>} just displaying strings. If you use this function to
291create a text combo box, you should only manipulate its data source with the
292following convenience functions: @code{gtk-combo-box-append-text},
293@code{gtk-combo-box-insert-text}, @code{gtk-combo-box-prepend-text} and
294@code{gtk-combo-box-remove-text}.
295
296@table @var
297@item ret
298A new text combo box.
299
300@end table
301
302Since 2.4
303
304@end deffn
305
306@deffn Function gtk-combo-box-append-text  (self@tie{}@code{<gtk-combo-box>}) (text@tie{}@code{mchars})
307@deffnx Method append-text
308Appends @var{string} to the list of strings stored in @var{combo-box}. Note that
309you can only use this function with combo boxes constructed with
310@code{gtk-combo-box-new-text}.
311
312@table @var
313@item combo-box
314A @code{<gtk-combo-box>} constructed using @code{gtk-combo-box-new-text}.
315
316@item text
317A string.
318
319@end table
320
321Since 2.4
322
323@end deffn
324
325@deffn Function gtk-combo-box-insert-text  (self@tie{}@code{<gtk-combo-box>}) (position@tie{}@code{int}) (text@tie{}@code{mchars})
326@deffnx Method insert-text
327Inserts @var{string} at @var{position} in the list of strings stored in
328@var{combo-box}. Note that you can only use this function with combo boxes
329constructed with @code{gtk-combo-box-new-text}.
330
331@table @var
332@item combo-box
333A @code{<gtk-combo-box>} constructed using @code{gtk-combo-box-new-text}.
334
335@item position
336An index to insert @var{text}.
337
338@item text
339A string.
340
341@end table
342
343Since 2.4
344
345@end deffn
346
347@deffn Function gtk-combo-box-prepend-text  (self@tie{}@code{<gtk-combo-box>}) (text@tie{}@code{mchars})
348@deffnx Method prepend-text
349Prepends @var{string} to the list of strings stored in @var{combo-box}. Note
350that you can only use this function with combo boxes constructed with
351@code{gtk-combo-box-new-text}.
352
353@table @var
354@item combo-box
355A @code{<gtk-combo-box>} constructed with @code{gtk-combo-box-new-text}.
356
357@item text
358A string.
359
360@end table
361
362Since 2.4
363
364@end deffn
365
366@deffn Function gtk-combo-box-remove-text  (self@tie{}@code{<gtk-combo-box>}) (position@tie{}@code{int})
367@deffnx Method remove-text
368Removes the string at @var{position} from @var{combo-box}. Note that you can
369only use this function with combo boxes constructed with
370@code{gtk-combo-box-new-text}.
371
372@table @var
373@item combo-box
374A @code{<gtk-combo-box>} constructed with @code{gtk-combo-box-new-text}.
375
376@item position
377Index of the item to remove.
378
379@end table
380
381Since 2.4
382
383@end deffn
384
385@deffn Function gtk-combo-box-get-active-text  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{mchars})
386@deffnx Method get-active-text
387Returns the currently active string in @var{combo-box} or @samp{@code{#f}} if
388none is selected. Note that you can only use this function with combo boxes
389constructed with @code{gtk-combo-box-new-text} and with
390@code{<gtk-combo-box-entry>}s.
391
392@table @var
393@item combo-box
394A @code{<gtk-combo-box>} constructed with @code{gtk-combo-box-new-text}.
395
396@item ret
397a newly allocated string containing the currently active text.
398
399@end table
400
401Since 2.6
402
403@end deffn
404
405@deffn Function gtk-combo-box-popup  (self@tie{}@code{<gtk-combo-box>})
406@deffnx Method popup
407Pops up the menu or dropdown list of @var{combo-box}.
408
409This function is mostly intended for use by accessibility technologies;
410applications should have little use for it.
411
412@table @var
413@item combo-box
414a @code{<gtk-combo-box>}
415
416@end table
417
418Since 2.4
419
420@end deffn
421
422@deffn Function gtk-combo-box-popdown  (self@tie{}@code{<gtk-combo-box>})
423@deffnx Method popdown
424Hides the menu or dropdown list of @var{combo-box}.
425
426This function is mostly intended for use by accessibility technologies;
427applications should have little use for it.
428
429@table @var
430@item combo-box
431a @code{<gtk-combo-box>}
432
433@end table
434
435Since 2.4
436
437@end deffn
438
439@deffn Function gtk-combo-box-get-popup-accessible  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{<atk-object>})
440@deffnx Method get-popup-accessible
441Gets the accessible object corresponding to the combo box's popup.
442
443This function is mostly intended for use by accessibility technologies;
444applications should have little use for it.
445
446@table @var
447@item combo-box
448a @code{<gtk-combo-box>}
449
450@item ret
451the accessible object corresponding to the combo box's popup.
452
453@end table
454
455Since 2.6
456
457@end deffn
458
459@deffn Function gtk-combo-box-set-add-tearoffs  (self@tie{}@code{<gtk-combo-box>}) (add_tearoffs@tie{}@code{bool})
460@deffnx Method set-add-tearoffs
461Sets whether the popup menu should have a tearoff menu item.
462
463@table @var
464@item combo-box
465a @code{<gtk-combo-box>}
466
467@item add-tearoffs
468@samp{@code{#t}} to add tearoff menu items
469
470@end table
471
472Since 2.6
473
474@end deffn
475
476@deffn Function gtk-combo-box-get-add-tearoffs  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{bool})
477@deffnx Method get-add-tearoffs
478Gets the current value of the :add-tearoffs property.
479
480@table @var
481@item combo-box
482a @code{<gtk-combo-box>}
483
484@item ret
485the current value of the :add-tearoffs property.
486
487@end table
488
489@end deffn
490
491@deffn Function gtk-combo-box-set-title  (self@tie{}@code{<gtk-combo-box>}) (title@tie{}@code{mchars})
492@deffnx Method set-title
493Sets the menu's title in tearoff mode.
494
495@table @var
496@item combo-box
497a @code{<gtk-combo-box>}
498
499@item title
500a title for the menu in tearoff mode.
501
502@end table
503
504Since 2.10
505
506@end deffn
507
508@deffn Function gtk-combo-box-get-title  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{mchars})
509@deffnx Method get-title
510Gets the current title of the menu in tearoff mode. See
511@code{gtk-combo-box-set-add-tearoffs}.
512
513@table @var
514@item combo-box
515a @code{<gtk-combo-box>}
516
517@item ret
518the menu's title in tearoff mode. This is an internal copy of the string which
519must not be freed.
520
521@end table
522
523Since 2.10
524
525@end deffn
526
527@deffn Function gtk-combo-box-set-focus-on-click  (self@tie{}@code{<gtk-combo-box>}) (focus_on_click@tie{}@code{bool})
528@deffnx Method set-focus-on-click
529Sets whether the combo box will grab focus when it is clicked with the mouse.
530Making mouse clicks not grab focus is useful in places like toolbars where you
531don't want the keyboard focus removed from the main area of the application.
532
533@table @var
534@item combo
535a @code{<gtk-combo-box>}
536
537@item focus-on-click
538whether the combo box grabs focus when clicked with the mouse
539
540@end table
541
542Since 2.6
543
544@end deffn
545
546@deffn Function gtk-combo-box-get-focus-on-click  (self@tie{}@code{<gtk-combo-box>}) @result{}@tie{} (ret@tie{}@code{bool})
547@deffnx Method get-focus-on-click
548Returns whether the combo box grabs focus when it is clicked with the mouse. See
549@code{gtk-combo-box-set-focus-on-click}.
550
551@table @var
552@item combo
553a @code{<gtk-combo-box>}
554
555@item ret
556@samp{@code{#t}} if the combo box grabs focus when it is clicked with the mouse.
557
558@end table
559
560Since 2.6
561
562@end deffn
563
564
565@c %end of fragment
566