Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ComboBoxActivateCallback

[766:7] extends: object

Generated low-level callback wrapper for GIR callback activate.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • 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.

    • @p Fn is the Aussom callback implementation.
    • @p 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.

class: ComboBox

[40:7] extends: object

A GtkComboBox is a widget that allows the user to choose from a list of valid choices. An example GtkComboBox The 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.

CSS nodes ``` combobox ├── box.linked │ ╰── button.combo │ ╰── box │ ├──

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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • ComboBox (model = null)

    Creates a new empty GtkComboBox.

    • @p 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asWidget ()

    Wraps this handle as Widget.

    • @r A Widget object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asCellEditable ()

    Wraps this handle as CellEditable.

    • @r A CellEditable object.
  • asCellLayout ()

    Wraps this handle as CellLayout.

    • @r A CellLayout object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnActivate (callback Fn, UserData = null)

    Emitted to when the combo box is activated. The ::activate signal on GtkComboBox is an action signal and emitting it causes the combo box to pop up its dropdown.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ComboBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r 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.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ComboBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r 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); }

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ComboBox Self, string Path).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnMoveactive (callback Fn, UserData = null)

    Emitted to move the active selection. This is an keybinding signal.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ComboBox Self, string Scroll_type).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r 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.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ComboBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r 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.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ComboBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r 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], where path is the [struct@Gtk.TreePath] of the active item.

    • @p Value is the new property value.
    • @r None.
  • setActiveid (string Value)

    The value of the ID column of the active row.

    • @p Value is the new property value.
    • @r None.
  • setButtonsensitivity (string Value)

    Whether the dropdown button is sensitive when the model is empty.

    • @p Value is the new property value.
    • @r None.
  • setChild (object Value)

    The child widget.

    • @p Value is the new property value.
    • @r 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.

    • @p Value is the new property value.
    • @r None.
  • setHasframe (bool Value)

    The has-frame property controls whether a frame is drawn around the entry.

    • @p Value is the new property value.
    • @r None.
  • setIdcolumn (int Value)

    The model column that provides string IDs for the values in the model, if != -1.

    • @p Value is the new property value.
    • @r None.
  • setModel (object Value)

    The model from which the combo box takes its values.

    • @p Value is the new property value.
    • @r None.
  • setPopupfixedwidth (bool Value)

    Whether the popup's width should be a fixed width matching the allocated width of the combo box.

    • @p Value is the new property value.
    • @r 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], where path is 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 GtkTreeModel of @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.

    • @r 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.

    • @r 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.

    • @p device is a GdkDevice.
    • @r None.
  • set_active (int index_)

    Sets the active item of @combo_box to be the item at @index.

    • @p index_ is An index in the model passed during construction, or -1 to have no active item.
    • @r None.
  • set_active_id (string active_id)

    Changes the active row of @combo_box to the one that has an ID equal to

    • @active_id. 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.
    • @p 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.

    • @p iter is The GtkTreeIter.
    • @r None.
  • set_button_sensitivity (string sensitivity)

    Sets whether the dropdown button of the combo box should update its sensitivity depending on the model contents.

    • @p sensitivity is specify the sensitivity of the dropdown button.
    • @r None.
  • set_child (object child)

    Sets the child widget of @combo_box.

    • @p child is the child widget.
    • @r 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.

    • @p text_column is A column in @model to get the strings from for the internal entry.
    • @r 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.

    • @p id_column is A column in @model to get string IDs for values from.
    • @r 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.

    • @p model is A GtkTreeModel.
    • @r 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.

    • @p fixed is whether to use a fixed popup width.
    • @r None.

class: ComboBoxMoveactiveCallback

[976:7] extends: object

Generated low-level callback wrapper for GIR callback move-active.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • 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.

    • @p Fn is the Aussom callback implementation.
    • @p 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.

class: ComboBoxPopupCallback

[1117:7] extends: object

Generated low-level callback wrapper for GIR callback popup.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • 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.

    • @p Fn is the Aussom callback implementation.
    • @p 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.

class: ComboBoxMeta

[1187:14] static extends: object

Generated metadata helpers for ComboBox class surfaces.

Methods

  • properties ()

    Returns property metadata for ComboBox.

    • @r A list.
  • signals ()

    Returns signal metadata for ComboBox.

    • @r A list.

class: ComboBoxCtors

[735:14] static extends: object

Alternate constructors for ComboBox. Usage: ComboBoxCtors.<name>(...). The primary constructor lives directly on ComboBox.

Methods

  • newWithEntry ()

    Creates a new empty GtkComboBox with 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].

    • @r A new ComboBox.
  • newWithModelAndEntry (object model)

    Creates a new empty GtkComboBox with an entry and a model. See also [ctor@Gtk.ComboBox.new_with_entry].

    • @p model is A GtkTreeModel.
    • @r A new ComboBox.

class: ComboBoxChangedCallback

[836:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • 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.

    • @p Fn is the Aussom callback implementation.
    • @p 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.

class: ComboBoxFormatentrytextCallback

[906:7] extends: object

Generated low-level callback wrapper for GIR callback format-entry-text.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • 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.

    • @p Fn is the Aussom callback implementation.
    • @p 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.

class: ComboBoxPopdownCallback

[1047:7] extends: object

Generated low-level callback wrapper for GIR callback popdown.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • 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.

    • @p Fn is the Aussom callback implementation.
    • @p 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.