package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Single_selection/index.html
Module Wrappers.Single_selection
type t = [ `single_selection | `object_ ] Gobject.objval new_ : Ocgtk_gio.Gio.Wrappers.List_model.t option -> tCreate a new SingleSelection
val set_selected : t -> int -> unitSelects the item at the given position.
If the list does not have an item at @position or %GTK_INVALID_LIST_POSITION is given, the behavior depends on the value of the property@Gtk.SingleSelection:autoselect property: If it is set, no change will occur and the old item will stay selected. If it is unset, the selection will be unset and no item will be selected.
val set_model : t -> Ocgtk_gio.Gio.Wrappers.List_model.t option -> unitSets the model that @self should wrap.
If @model is %NULL, @self will be empty.
val set_can_unselect : t -> bool -> unitIf %TRUE, unselecting the current item via gtk_selection_model_unselect_item() is supported.
Note that setting property@Gtk.SingleSelection:autoselect will cause unselecting to not work, so it practically makes no sense to set both at the same time the same time.
val set_autoselect : t -> bool -> unitEnables or disables autoselect.
If @autoselect is %TRUE, @self will enforce that an item is always selected. It will select a new item when the currently selected item is deleted and it will disallow unselecting the current item.
val get_selected_item : t -> [ `object_ ] Gobject.obj optionGets the selected item.
If no item is selected, %NULL is returned.
val get_selected : t -> intGets the position of the selected item.
If no item is selected, %GTK_INVALID_LIST_POSITION is returned.
val get_model : t -> Ocgtk_gio.Gio.Wrappers.List_model.t optionGets the model that @self is wrapping.
val get_can_unselect : t -> boolIf %TRUE, gtk_selection_model_unselect_item() is supported and allows unselecting the selected item.
val get_autoselect : t -> boolChecks if autoselect has been enabled or disabled via gtk_single_selection_set_autoselect().
val get_item_type : t -> Gobject.Type.tGet property: item-type
val get_n_items : t -> intGet property: n-items