Skip to main content

Type Alias: GtkComboBoxProps

GtkComboBoxProps = WidgetProps & object

Defined in: generated/jsx.ts:2890

Props for the GtkComboBox widget.

Type Declaration

NameTypeDescriptionDefined in
active?numberThe 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 TreePath of the active item.generated/jsx.ts:2899
activeId?string | nullThe value of the ID column of the active row.generated/jsx.ts:2901
buttonSensitivity?Gtk.SensitivityTypeWhether the dropdown button is sensitive when the model is empty.generated/jsx.ts:2906
child?Gtk.Widget | nullThe child widget.generated/jsx.ts:2908
children?ReactNode-generated/jsx.ts:3032
editingCanceled?booleanIndicates whether editing on the cell has been canceled.generated/jsx.ts:2931
entryTextColumn?numberThe model column to associate with strings from the entry. This is property only relevant if the combo was created with ComboBox.has-entry is %TRUE.generated/jsx.ts:2915
hasFrame?booleanThe has-frame property controls whether a frame is drawn around the entry.generated/jsx.ts:2917
idColumn?numberThe model column that provides string IDs for the values in the model, if != -1.generated/jsx.ts:2922
model?Gtk.TreeModel | nullThe model from which the combo box takes its values.generated/jsx.ts:2924
onActivate()?(self) => void | nullEmitted 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.generated/jsx.ts:2938
onChanged()?(self) => void | nullEmitted 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 ComboBox.set_active_iter. It will also be emitted while typing into the entry of a combo box with an entry.generated/jsx.ts:2946
onEditingDone()?(self) => void | nullThis signal is a sign for the cell renderer to update its value from the cell_editable. Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing, e.g. GtkEntry emits this signal when the user presses Enter. Typical things to do in a handler for ::editing-done are to capture the edited value, disconnect the cell_editable from signals on the GtkCellRenderer, etc. gtk_cell_editable_editing_done() is a convenience method for emitting GtkCellEditable::editing-done.generated/jsx.ts:3016
onFormatEntryText()?(self, path) => string | nullEmitted to allow changing how the text in a combo box's entry is displayed. See 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 ComboBox.entry-text-column model column. Here's an example signal handler which fetches data from the model and displays it in the entry. 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); }generated/jsx.ts:2980
onMoveActive()?(self, scrollType) => void | nullEmitted to move the active selection. This is an keybinding signal.generated/jsx.ts:2986
onNotify?(self, propName) => void | nullCalled when any property on this widget changes. Param The widget that emitted the notification Param The name of the property that changed (in kebab-case)generated/jsx.ts:3038
onPopdown()?(self) => boolean | nullEmitted to popdown the combo box list. This is an keybinding signal. The default bindings for this signal are Alt+Up and Escape.generated/jsx.ts:2994
onPopup()?(self) => void | nullEmitted to popup the combo box list. This is an keybinding signal. The default binding for this signal is Alt+Down.generated/jsx.ts:3002
onRemoveWidget()?(self) => void | nullThis signal is meant to indicate that the cell is finished editing, and the cell_editable widget is being removed and may subsequently be destroyed. Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing. It must be emitted after the GtkCellEditable::editing-done signal, to give the cell renderer a chance to update the cell's value before the widget is removed. gtk_cell_editable_remove_widget() is a convenience method for emitting GtkCellEditable::remove-widget.generated/jsx.ts:3031
popupFixedWidth?booleanWhether the popup's width should be a fixed width matching the allocated width of the combo box.generated/jsx.ts:2929
ref?Ref<Gtk.ComboBox>-generated/jsx.ts:3055