[Type] Callback

Part of: mobl
Inherits from: mobl::Object

Callback is essentially an alias for Function1<DOMEvent,?>. It is typically used to handle UI events.

Instantiation

A new Callback can be created by using the callback literal syntax.

Example:

var cb = { alert("Hello!"); };
screen root() {
  button("OK", onclick={
    alert("Hello!");
  })
}

A callback literal gets an implicit argument event of type DOMEvent that can be used to get more information about the event.

mobl/callback.txt · Last modified: 2013/10/01 02:28 (external edit)