package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/List_box_row/index.html

Module Wrappers.List_box_row

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

Create a new ListBoxRow

val set_selectable : t -> bool -> unit

Set whether the row can be selected.

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

Sets the current header of the @row.

This is only allowed to be called from a callback@Gtk.ListBoxUpdateHeaderFunc. It will replace any existing header in the row, and be shown in front of the row in the listbox.

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

Sets the child widget of @self.

val set_activatable : t -> bool -> unit

Set whether the row is activatable.

val is_selected : t -> bool

Returns whether the child is currently selected in its `GtkListBox` container.

val get_selectable : t -> bool

Gets whether the row can be selected.

val get_index : t -> int

Gets the current index of the @row in its `GtkListBox` container.

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

Returns the current header of the @row.

This can be used in a callback@Gtk.ListBoxUpdateHeaderFunc to see if there is a header set already, and if so to update the state of it.

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

Gets the child widget of @row.

val get_activatable : t -> bool

Gets whether the row is activatable.

val changed : t -> unit

Marks @row as changed, causing any state that depends on this to be updated.

This affects sorting, filtering and headers.

Note that calls to this method must be in sync with the data used for the row functions. For instance, if the list is mirroring some external data set, and *two* rows changed in the external data set then when you call gtk_list_box_row_changed() on the first row the sort function must only read the new data for the first of the two changed rows, otherwise the resorting of the rows will be wrong.

This generally means that if you don’t fully control the data model you have to duplicate the data that affects the listbox row functions into the row widgets themselves. Another alternative is to call method@Gtk.ListBox.invalidate_sort on any model change, but that is more expensive.

val on_activate : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id