package stk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Stk.ObjectSource

Objects.

Class o is the base class for widget and other classes which can trigger events and hold properties Props.props.

Sourcetype Events.ev +=
  1. | Prop_changed : 'a Props.prop -> (prev:'a option -> now:'a -> unit) Events.ev

Introduce the Prop_changed property to register callbacks called when the value of a given property changed. Previous and current values of the property are passed to the callback.

Sourcetype id = Oid.t

Object id. Each object of o is given a unique id.

Sourceval transition_step_delay : int

Transition step minimum delay, in milliseconds.

Sourceclass o : ?props:Props.t option -> unit -> object ... end

An object. See Widget arguments for props arguments.

Sourceval add_mirror : src:(o * 'a Props.prop) -> dst:(o * 'b Props.prop) -> map_to:('a -> 'b) -> map_from:('b -> 'a) -> Events.callback_id * Events.callback_id

add_mirror ~src:(object1,prop1) ~dst:(object2,prop2) ~map_to ~map_from registers event handlers to that a change on prop1 in object1 triggers a change of propery prop2 of object2, using map_to to map the new value of prop1 to the value given to prop2, and conversely (using map_from). The function returns the event handlers on object1 and object2, so that this mirror can be removed using object1#disconnect id1; object2#disconnect id2.

Sourceval add_mirror_id : src:(o * 'a Props.prop) -> dst:(o * 'a Props.prop) -> Events.callback_id * Events.callback_id

Same as add_mirror, using Fun.id as mappers, i.e. when both properties have the same time and meaning.