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/String_list/index.html

Module Wrappers.String_list

type t = [ `string_list | `object_ ] Gobject.obj
val new_ : string array option -> t

Create a new StringList

val take : t -> string -> unit

Adds @string to self at the end, and takes ownership of it.

This variant of method@Gtk.StringList.append is convenient for formatting strings:

```c gtk_string_list_take (self, g_strdup_print ("%d dollars", lots)); ```

val splice : t -> int -> int -> string array option -> unit

Changes @self by removing @n_removals strings and adding @additions to it.

This function is more efficient than method@Gtk.StringList.append and method@Gtk.StringList.remove, because it only emits the ::items-changed signal once for the change.

This function copies the strings 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 : t -> int -> unit

Removes the string at @position from @self.

@position must be smaller than the current length of the list.

val get_string : t -> int -> string option

Gets the string that is at @position in @self.

If @self does not contain @position items, %NULL is returned.

This function returns the const char *. To get the object wrapping it, use g_list_model_get_item().

val append : t -> string -> unit

Appends @string to @self.

The @string will be copied. See method@Gtk.StringList.take for a way to avoid that.

val get_item_type : t -> Gobject.Type.t

Get property: item-type

val get_n_items : t -> int

Get property: n-items