package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Expression/index.html
Module Wrappers.Expression
type t = [ `expression ] Gobject.objval unref : t -> unitReleases a reference on the given `GtkExpression`.
If the reference was the last, the resources associated to the `self` are freed.
val is_static : t -> boolChecks 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.tGets 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 -> boolEvaluates 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.objBind `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.