package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Combo_box

type t = [ `combo_box | `widget | `initially_unowned | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new ComboBox

val new_with_entry : unit -> t

Create a new ComboBox

val new_with_model : [ `tree_model ] Gobject.obj -> t

Create a new ComboBox

val new_with_model_and_entry : [ `tree_model ] Gobject.obj -> t

Create a new ComboBox

val set_popup_fixed_width : t -> bool -> unit

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.

val set_model : t -> [ `tree_model ] Gobject.obj option -> unit

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.

val set_id_column : t -> int -> unit

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.

val set_entry_text_column : t -> int -> unit

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.

val set_child : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

Sets the child widget of @combo_box.

val set_button_sensitivity : t -> Gtk_enums.sensitivitytype -> unit

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

val set_active_iter : t -> [ `tree_iter ] Gobject.obj option -> unit

Sets the current active item to be the one referenced by @iter.

If @iter is %NULL, the active item is unset.

val set_active_id : t -> string option -> bool

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.

val set_active : t -> int -> unit

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

val popup_for_device : t -> Ocgtk_gdk.Gdk.Wrappers.Device.t -> unit

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.

val popup : t -> unit

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.

val popdown : t -> unit

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.

val get_popup_fixed_width : t -> bool

Gets whether the popup uses a fixed width.

val get_model : t -> [ `tree_model ] Gobject.obj option

Returns the `GtkTreeModel` of @combo_box.

val get_id_column : t -> int

Returns the column which @combo_box is using to get string IDs for values from.

val get_has_entry : t -> bool

Returns whether the combo box has an entry.

val get_entry_text_column : t -> int

Returns the column which @combo_box is using to get the strings from to display in the internal entry.

val get_child : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option

Gets the child widget of @combo_box.

val get_button_sensitivity : t -> Gtk_enums.sensitivitytype

Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.

val get_active_iter : t -> bool * [ `tree_iter ] Gobject.obj

Sets @iter to point to the currently active item.

If no item is active, @iter is left unchanged.

val get_active_id : t -> string option

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.

val get_active : t -> int

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.

val get_has_frame : t -> bool

Get property: has-frame

val set_has_frame : t -> bool -> unit

Set property: has-frame

val get_popup_shown : t -> bool

Get property: popup-shown

val on_activate : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_changed : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_format_entry_text : ?after:bool -> t -> callback:(path:string -> string) -> Gobject.Signal.handler_id
val on_move_active : ?after:bool -> t -> callback:(scroll_type:Gtk_enums.scrolltype -> unit) -> Gobject.Signal.handler_id
val on_popdown : ?after:bool -> t -> callback:(unit -> bool) -> Gobject.Signal.handler_id
val on_popup : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id