package stk_xml

  1. Overview
  2. Docs

Module Stk_xml.EpropsSource

CSS properties for events.

Here is provided a way to embed Stk event handlers in CSS properties, so that such handlers can be connected to widgets created from XML nodes matching CSS selectors.

CSS statements with these properties are added to the XML view (with the View.xmlview.set_event_css) so that they are automatically associated when the widgets used to display the XML document are created.

Sourcetype 'a event_prop = (Doc.node -> 'a) list Css.P.prop

A CSS property whose value is a list of handlers for an event.

Sourceval event_prop : ?name:string -> ?inherited:bool -> 'a Stk.Events.ev -> 'a event_prop

event_prop event creates a new property to store handlers for the given event. Optional argument name is the property name; if it is not provided, a string representation of the event constructor is used. The optional argument inherited indicates whether this property is inherited by children nodes. Default is false.

Sourceval event_rule : 'a Stk.Events.ev -> (Doc.node -> 'a) -> string -> string Css.S.rule_

event_rule ev handler selector creates a CSS rule that will associate the handler to the event ev for XML nodes matching the CSS selector. An event property is automatically created for the event ev if it does not exist yet.

When a rule adds a handler for an event, this handler is added to the other handlers of the same event when computing values of properties. For example, two rules can each add a handler for the same event to the same node, resulting in having the corresponding widgets having two handlers connected for the same event.

Sourceval event_statement : 'a Stk.Events.ev -> (Doc.node -> 'a) -> string -> string Css.S.statement

Same as event_rule but the rule is embedded in a CSS statement.

OCaml

Innovation. Community. Security.