open fun <T : Widget> setEventListener(block: SnOn<T>.() -> Unit): Widget
Sets an event listener for current widget, keeping the actual type of component.
Return
current widget
Example:
button.setEventListener<Button> {
dblclick = {
Alert.show("Button double clicked!")
// self is of type Button here
}
}
open fun setEventListener(block: SnOn<Widget>.() -> Unit): Widget
Sets an event listener for current widget.
Return
current widget
Example:
button.setEventListener {
dblclick = {
Alert.show("Button double clicked!")
// self is of type Widget here
}
}