package stk

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

Module Stk.EventsSource

Events and callback registration.

The event type ev is an extensible type. Some basic events are defined in Widget, others are specific to some widgets and are defined in the corresponding modules (for example in Clist or Textbuffer). Code using the Stk library can add its own events, then use trigger* methods in Object.o to trigger events and the callback registration mecanism below (or through the connect and disconnect methods of Object.o).

Sourcetype callbacks
Sourceval callbacks : unit -> callbacks

Return a fresh structure to register callbacks.

Sourcetype callback_id
Sourceval pp_callback_id : Format.formatter -> callback_id -> unit
Sourcetype _ ev = ..
Sourceval register : callbacks -> ?count:int -> 'a ev -> 'a -> callback_id

register callbacks ev cb registers cb in callbacks to be called when event ev is trigged. The returned callback id can be used to unregister the callback. Optional parameter count indicates the number of times the callback is called before being unregistered. Default is None, i.e. callback is not unregistered.

Sourceval get : callbacks -> 'a ev -> 'a list

get callbacks ev returns the list of callbacks associated to event ev in callbacks.

Sourceval unregister : callback_id -> unit

unregister id unregister the callback associated to id.

Sourcemodule type S = sig ... end
Sourcemodule Make_map (V : sig ... end) : S with type 'a value = 'a V.t
OCaml

Innovation. Community. Security.