[766:7] extends: object
Generated low-level callback wrapper for GIR callback activate.
ComboBoxActivateCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[40:7] extends: object
A GtkComboBox is a widget that allows the user to choose from a list of
valid choices.
GtkComboBox displays the selected
choice; when activated, the GtkComboBox displays a popup which allows the
user to make a new choice. The GtkComboBox uses the model-view pattern; the
list of valid choices is specified in the form of a tree model, and the
display of the choices can be adapted to the data in the model by using cell
renderers, as you would in a tree view. This is possible since GtkComboBox
implements the [iface@Gtk.CellLayout] interface. The tree model holding the
valid choices is not restricted to a flat list, it can be a real tree, and
the popup will reflect the tree structure. To allow the user to enter values
not in the model, the [property@Gtk.ComboBox:has-entry] property allows the
GtkComboBox to contain a [class@Gtk.Entry]. This entry can be accessed by
calling [method@Gtk.ComboBox.get_child] on the combo box. For a simple list
of textual choices, the model-view API of GtkComboBox can be a bit
overwhelming. In this case, [class@Gtk.ComboBoxText] offers a simple
alternative. Both GtkComboBox and GtkComboBoxText can contain an entry.
cellview │ ╰── arrow ╰── window.popup A normal combobox contains a box with the .linked class, a button with the .combo class and inside those buttons, there are a cellview and an arrow. combobox ├── box.linked │ ├──
entry.combo │ ╰── button.combo │ ╰── box │ ╰── arrow ╰── window.popup ``` A
GtkComboBox with an entry has a single CSS node with name combobox. It
contains a box with the .linked class. That box contains an entry and a
button, both with the .combo class added. The button also contains another
node with name arrow. ## Accessibility GtkComboBox uses the
[enum@Gtk.AccessibleRole.combo_box] role.
ComboBox (model = null)
Creates a new empty
GtkComboBox.
model is a GtkTreeModel.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asWidget ()
Wraps this handle as
Widget.
A Widget object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asCellEditable ()
Wraps this handle as
CellEditable.
A CellEditable object.asCellLayout ()
Wraps this handle as
CellLayout.
A CellLayout object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
A ConstraintTarget object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnActivate (callback Fn, UserData = null)
Emitted to when the combo box is activated. The
::activatesignal onGtkComboBoxis an action signal and emitting it causes the combo box to pop up its dropdown.
Fn is the Aussom callback.Fn is called with (ComboBox Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.setOnChanged (callback Fn, UserData = null)
Emitted when the active item is changed. The can be due to the user selecting a different item from the list, or due to a call to [method@Gtk.ComboBox.set_active_iter]. It will also be emitted while typing into the entry of a combo box with an entry.
Fn is the Aussom callback.Fn is called with (ComboBox Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.setOnFormatentrytext (callback Fn, UserData = null)
Emitted to allow changing how the text in a combo box's entry is displayed. See [property@Gtk.ComboBox:has-entry]. Connect a signal handler which returns an allocated string representing @path. That string will then be used to set the text in the combo box's entry. The default signal handler uses the text from the [property@Gtk.ComboBox:entry-text-column] model column. Here's an example signal handler which fetches data from the model and displays it in the entry.
c static char * format_entry_text_callback (GtkComboBox *combo, const char *path, gpointer user_data) { GtkTreeIter iter; GtkTreeModel model; double value; model = gtk_combo_box_get_model (combo); gtk_tree_model_get_iter_from_string (model, &iter, path); gtk_tree_model_get (model, &iter, THE_DOUBLE_VALUE_COLUMN, &value, -1); return g_strdup_printf ("%g", value); }
Fn is the Aussom callback.Fn is called with (ComboBox Self, string Path).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.setOnMoveactive (callback Fn, UserData = null)
Emitted to move the active selection. This is an keybinding signal.
Fn is the Aussom callback.Fn is called with (ComboBox Self, string Scroll_type).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.setOnPopdown (callback Fn, UserData = null)
Emitted to popdown the combo box list. This is an keybinding signal. The default bindings for this signal are Alt+Up and Escape.
Fn is the Aussom callback.Fn is called with (ComboBox Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.setOnPopup (callback Fn, UserData = null)
Emitted to popup the combo box list. This is an keybinding signal. The default binding for this signal is Alt+Down.
Fn is the Aussom callback.Fn is called with (ComboBox Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setActive (int Value)
The item which is currently active. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this property has the value
gtk_tree_path_get_indices (path)[0], wherepathis the [struct@Gtk.TreePath] of the active item.
Value is the new property value.None.setActiveid (string Value)
The value of the ID column of the active row.
Value is the new property value.None.setButtonsensitivity (string Value)
Whether the dropdown button is sensitive when the model is empty.
Value is the new property value.None.setChild (object Value)
The child widget.
Value is the new property value.None.setEntrytextcolumn (int Value)
The model column to associate with strings from the entry. This is property only relevant if the combo was created with [property@Gtk.ComboBox:has-entry] is %TRUE.
Value is the new property value.None.setHasframe (bool Value)
The
has-frameproperty controls whether a frame is drawn around the entry.
Value is the new property value.None.setIdcolumn (int Value)
The model column that provides string IDs for the values in the model, if != -1.
Value is the new property value.None.setModel (object Value)
The model from which the combo box takes its values.
Value is the new property value.None.setPopupfixedwidth (bool Value)
Whether the popup's width should be a fixed width matching the allocated width of the combo box.
Value is the new property value.None.get_active ()
Returns the index of the currently active item. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns
gtk_tree_path_get_indices (path)[0], wherepathis the [struct@Gtk.TreePath] of the active item.
get_active_id ()
Returns the ID of the active row of @combo_box. This value is taken from the active row and the column specified by the [property@Gtk.ComboBox:id-column] property of @combo_box (see [method@Gtk.ComboBox.set_id_column]). The returned value is an interned string which means that you can compare the pointer by value to other interned strings and that you must not free it. If the [property@Gtk.ComboBox:id-column] property of @combo_box is not set, or if no row is active, or if the active row has a %NULL ID value, then %NULL is returned.
get_button_sensitivity ()
Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.
get_child ()
Gets the child widget of @combo_box.
get_entry_text_column ()
Returns the column which @combo_box is using to get the strings from to display in the internal entry.
get_has_entry ()
Returns whether the combo box has an entry.
get_id_column ()
Returns the column which @combo_box is using to get string IDs for values from.
get_model ()
Returns the
GtkTreeModelof @combo_box.
get_popup_fixed_width ()
Gets whether the popup uses a fixed width.
popdown ()
Hides the menu or dropdown list of @combo_box. This function is mostly intended for use by accessibility technologies; applications should have little use for it.
None.popup ()
Pops up the menu or dropdown list of @combo_box. This function is mostly intended for use by accessibility technologies; applications should have little use for it. Before calling this, @combo_box must be mapped, or nothing will happen.
None.popup_for_device (object device)
Pops up the menu of @combo_box. Note that currently this does not do anything with the device, as it was previously only used for list-mode combo boxes, and those were removed in GTK 4. However, it is retained in case similar functionality is added back later.
device is a GdkDevice.None.set_active (int index_)
Sets the active item of @combo_box to be the item at @index.
index_ is An index in the model passed during construction, or -1 to have no active item.None.set_active_id (string active_id)
Changes the active row of @combo_box to the one that has an ID equal to
If @active_id is %NULL, the active row is unset. Rows having a %NULL ID string cannot be made active by this function. If the [property@Gtk.ComboBox:id-column] property of @combo_box is unset or if no row has the given ID then the function does nothing and returns %FALSE.active_id is the ID of the row to select.set_active_iter (iter)
Sets the current active item to be the one referenced by @iter. If @iter is %NULL, the active item is unset.
iter is The GtkTreeIter.None.set_button_sensitivity (string sensitivity)
Sets whether the dropdown button of the combo box should update its sensitivity depending on the model contents.
sensitivity is specify the sensitivity of the dropdown button.None.set_child (object child)
Sets the child widget of @combo_box.
child is the child widget.None.set_entry_text_column (int text_column)
Sets the model column which @combo_box should use to get strings from to be @text_column. For this column no separate [class@Gtk.CellRenderer] is needed. The column @text_column in the model of @combo_box must be of type %G_TYPE_STRING. This is only relevant if @combo_box has been created with [property@Gtk.ComboBox:has-entry] as %TRUE.
text_column is A column in @model to get the strings from for the internal entry.None.set_id_column (int id_column)
Sets the model column which @combo_box should use to get string IDs for values from. The column @id_column in the model of @combo_box must be of type %G_TYPE_STRING.
id_column is A column in @model to get string IDs for values from.None.set_model (object model)
Sets the model used by @combo_box to be @model. Will unset a previously set model (if applicable). If model is %NULL, then it will unset the model. Note that this function does not clear the cell renderers, you have to call [method@Gtk.CellLayout.clear] yourself if you need to set up different cell renderers for the new model.
model is A GtkTreeModel.None.set_popup_fixed_width (bool fixed)
Specifies whether the popup’s width should be a fixed width. If @fixed is %TRUE, the popup's width is set to match the allocated width of the combo box.
fixed is whether to use a fixed popup width.None.[976:7] extends: object
Generated low-level callback wrapper for GIR callback move-active.
ComboBoxMoveactiveCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, scroll_type, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[1117:7] extends: object
Generated low-level callback wrapper for GIR callback popup.
ComboBoxPopupCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[1187:14] static extends: object
Generated metadata helpers for ComboBox class surfaces.
properties ()
Returns property metadata for
ComboBox.
A list.signals ()
Returns signal metadata for
ComboBox.
A list.[735:14] static extends: object
Alternate constructors for ComboBox. Usage:
ComboBoxCtors.<name>(...). The primary constructor lives
directly on ComboBox.
newWithEntry ()
Creates a new empty
GtkComboBoxwith an entry. In order to use a combo box with entry, you need to tell it which column of the model contains the text for the entry by calling [method@Gtk.ComboBox.set_entry_text_column].
A new ComboBox.newWithModelAndEntry (object model)
Creates a new empty
GtkComboBoxwith an entry and a model. See also [ctor@Gtk.ComboBox.new_with_entry].
model is A GtkTreeModel.A new ComboBox.[836:7] extends: object
Generated low-level callback wrapper for GIR callback changed.
ComboBoxChangedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[906:7] extends: object
Generated low-level callback wrapper for GIR callback format-entry-text.
ComboBoxFormatentrytextCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, path, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[1047:7] extends: object
Generated low-level callback wrapper for GIR callback popdown.
ComboBoxPopdownCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.