Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Stk_xml.Eprops
SourceCSS 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.
A CSS property whose value is a list of handlers for an event.
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
.
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.
val 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.