package stk

  1. Overview
  2. Docs
SDL-based GUI toolkit

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-stk-0.4.0.tar.bz2
md5=4a7d5aeecb002fa711a6eb002a544713
sha512=f2efc05917d5916980a8d09426b629028a748c00c19667b0bf4e0cf0c8811d80b5a693b95f662301bfbe3162cefd73e7f02e98cb5c1020876cbcf9fc81930434

doc/stk/Stk/Events/index.html

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.