GtkComboBox
A widget used to choose from a list of items.
Object Hierarchy
Direct Subclasses
Implemented Interfaces
Description
The GtkComboBox is a replacement for the GtkOptionMenu and GtkCombo widgets, providing a solution that allows the user to choose from a list of options.
A GtkComboBox implements the GtkCellLayout interface, that provides a number of useful methods for managing the contents, adopting a model-view pattern. The constructor can be associated with an optional GtkTreeModel, which can otherwise be added later with the set_model() method.
Alternatively, the new_text function creates a simple GtkComboBox and associated GtkListStore model. A GtkCellRendererText is also created and packed in the new combo box. In this simple combo box each list item is a text string that can be selected. The convenience methods append_text() , prepend_text() , insert_text() and remove_text() can be used to manage the contents of the GtkComboBox.
Constructors
-- Creates a new GtkComboBox
-- Constructs a new text combo box
Methods
append_text() Appends the string specified by text to the list of strings. get_active() Returns the index in the model of the currently active item. get_active_iter() Returns the current item. get_active_text() Returns the current string. get_column_span_column() Returns the value of the "column-span-column" property. get_focus_on_click() Returns the value of the "focus-on-click" property. get_model() Returns the value of the "model" property. get_popup_accessible() Gets the object corresponding to the popup. get_row_span_column() Returns the value of the "row-span-column" property. get_wrap_width() Returns the value of the "wrap-width" property. insert_text() Inserts a string in the combo box. popdown() Hides the menu or dropdown list of the combo box. popup() Pops up the menu or dropdown list. prepend_text() Prepends the string specified by text to the list of strings. remove_text() Removes the string at the index. set_active() Sets the active item of the combo_box. set_active_iter() Sets the current active item. set_add_tearoffs() Sets the "add-tearoffs" property. set_column_span_column() Sets the "column-span-column" property. set_focus_on_click() Sets the value of the "focus-on-click" property. set_model() Sets the model used by the combo box. set_row_separator_func() Sets the row separator function. set_row_span_column() Sets the "row-span-column" property. set_wrap_width() Sets the wrap width property of the combo box.
Signals
"changed" The "changed" signal is emitted when a new item in the combo box is selected.