RootElement

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Properties

Link copied to clipboard

This is a delicate API that exposes the raw attribute backing without any type safety. This is frequently used by the internals of Krayon, but is likely something you shouldn't use as a library consumer. That said, it's still exposed for the cases where it's necessary. When using this, be very careful not to clobber existing attributes.

Link copied to clipboard
Link copied to clipboard
var data: Any?
Link copied to clipboard
var kind: String?

Analogous to an HTML class, except you can only have one.

Link copied to clipboard
var onClickFallback: () -> Unit?

If set, this callback is invoked when onClick is called but no descendant element handles that event.

Link copied to clipboard
open var parent: Element?
Link copied to clipboard
open override val tag: String

Functions

Link copied to clipboard
open fun <E : Element> appendChild(child: E): E
Link copied to clipboard
open override fun draw(kanvas: Kanvas)
Link copied to clipboard
open fun <E : Element> insertBefore(child: E, reference: Element?): E
Link copied to clipboard
fun matches(selector: ElementSelector<*>): Boolean
Link copied to clipboard
fun onClick(isPointInPath: IsPointInPath, x: Float, y: Float)

Entry point for dispatching click events. Usually you won't need to call this, and it will be handled by your platform-specific ElementView.

Link copied to clipboard
fun onHover(isPointInPath: IsPointInPath, x: Float, y: Float)

Entry point for dispatching hover events, both start and move. Usually you won't need to call this, and it will be handled by your platform-specific ElementView.

Link copied to clipboard

Entry point for dispatching hover-end events. Usually you won't need to call this, and it will be handled by your platform-specific ElementView.

Link copied to clipboard
open fun <E : Element> query(selector: ElementSelector<E>): E?
Link copied to clipboard
open fun <E : Element> queryAll(selector: ElementSelector<E>): Sequence<E>
Link copied to clipboard
fun <E : Element> removeChild(child: E): E
Link copied to clipboard
open override fun toString(): String