Skip to content

Commit ccf3687

Browse files
FSaurenbachjobe-m
andauthored
1 parent 572b9b6 commit ccf3687

File tree

1 file changed

+5
-0
lines changed
  • korge/src/korlibs/korge/view

1 file changed

+5
-0
lines changed

korge/src/korlibs/korge/view/View.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,11 @@ fun <T : View> T.onNextFrame(block: T.(views: Views) -> Unit): CloseableCancella
15681568
return closeable
15691569
}
15701570

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

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

0 commit comments

Comments
 (0)