The OpenD Programming Language

Widget.subscribe

Does the same as addEventListener's delegate overload, but adds an additional check to ensure the event you are subscribing to is actually emitted by the static type you are using. Since it works on static types, if you have a generic Widget, this can only subscribe to events declared as Emits inside Widget itself, not any child classes nor any child elements. If this is too restrictive, simply use addEventListener instead.

class Widget
final
subscribe
(
EventType
this This
)
(
void delegate
(
EventType
)
handler
)

Meta

History

Added May 5, 2021