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 callback_id
Sourcetype _ ev = ..
Sourceval register : Oid.t -> 'a ev -> 'a -> callback_id

register o ev cb registers cb as callback when event ev is trigged on object o. The returned callback id can be used to unregister the callback.

Sourceval get : Oid.t -> 'a ev -> 'a list

get o ev returns the list of callbacks associated to event ev on object o.

Sourceval unregister : callback_id -> unit

unregister id unregister the callback associated to id.

OCaml

Innovation. Community. Security.