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.gio/Ocgtk_gio/Gio/Wrappers/List_store/index.html

Module Wrappers.List_store

type t = [ `list_store | `object_ ] Gobject.obj
val new_ : Gobject.Type.t -> t

Create a new ListStore

val splice : t -> int -> int -> [ `object_ ] Gobject.obj array -> int -> unit

Changes @store by removing @n_removals items and adding @n_additions items to it. @additions must contain @n_additions items of type #GListStore:item-type. %NULL is not permitted.

This function is more efficient than g_list_store_insert() and g_list_store_remove(), because it only emits #GListModel::items-changed once for the change.

This function takes a ref on each item in @additions.

The parameters @position and @n_removals must be correct (ie: @position + @n_removals must be less than or equal to the length of the list at the time this function is called).

val remove_all : t -> unit

Removes all items from @store.

val remove : t -> int -> unit

Removes the item from @store that is at @position. @position must be smaller than the current length of the list.

Use g_list_store_splice() to remove multiple items at the same time efficiently.

val insert : t -> int -> [ `object_ ] Gobject.obj -> unit

Inserts @item into @store at @position. @item must be of type #GListStore:item-type or derived from it. @position must be smaller than the length of the list, or equal to it to append.

This function takes a ref on @item.

Use g_list_store_splice() to insert multiple items at the same time efficiently.

val find : t -> [ `object_ ] Gobject.obj -> bool * int

Looks up the given @item in the list store by looping over the items until the first occurrence of @item. If @item was not found, then @position will not be set, and this method will return %FALSE.

If you need to compare the two items with a custom comparison function, use g_list_store_find_with_equal_func() with a custom #GEqualFunc instead.

val append : t -> [ `object_ ] Gobject.obj -> unit

Appends @item to @store. @item must be of type #GListStore:item-type.

This function takes a ref on @item.

Use g_list_store_splice() to append multiple items at the same time efficiently.

val get_item_type : t -> Gobject.Type.t

Get property: item-type

val get_n_items : t -> int

Get property: n-items