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

Module Wrappers.Expression

type t = [ `expression ] Gobject.obj
val unref : t -> unit

Releases a reference on the given `GtkExpression`.

If the reference was the last, the resources associated to the `self` are freed.

val ref : t -> t

Acquires a reference on the given `GtkExpression`.

val is_static : t -> bool

Checks if the expression is static.

A static expression will never change its result when method@Gtk.Expression.evaluate is called on it with the same arguments.

That means a call to method@Gtk.Expression.watch is not necessary because it will never trigger a notify.

val get_value_type : t -> Gobject.Type.t

Gets the `GType` that this expression evaluates to.

This type is constant and will not change over the lifetime of this expression.

val evaluate : t -> [ `object_ ] Gobject.obj option -> Gobject.Value.t -> bool

Evaluates the given expression and on success stores the result in @value.

The `GType` of `value` will be the type given by method@Gtk.Expression.get_value_type.

It is possible that expressions cannot be evaluated - for example when the expression references objects that have been destroyed or set to `NULL`. In that case `value` will remain empty and `FALSE` will be returned.

val bind : t -> [ `object_ ] Gobject.obj -> string -> [ `object_ ] Gobject.obj option -> [ `expression_watch ] Gobject.obj

Bind `target`'s property named `property` to `self`.

The value that `self` evaluates to is set via `g_object_set()` on `target`. This is repeated whenever `self` changes to ensure that the object's property stays synchronized with `self`.

If `self`'s evaluation fails, `target`'s `property` is not updated. You can ensure that this doesn't happen by using a fallback expression.

Note that this function takes ownership of `self`. If you want to keep it around, you should method@Gtk.Expression.ref it beforehand.