Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions korge/src/korlibs/korge/view/View.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,11 @@ fun <T : View> T.onNextFrame(block: T.(views: Views) -> Unit): CloseableCancella
return closeable
}

/** Add an arbitrary view to a mutable list. */
fun <T : View> T.addTo(parent: MutableList<in T>): T {
parent += this
return this
}

// @TODO: Replace width, height with SizeInt
fun <T : View> T.onStageResized(firstTrigger: Boolean = true, block: Views.(width: Int, height: Int) -> Unit): T = this.apply {
Expand Down
Loading