Skip to content

Commit

Permalink
[orx-gui] Add <T: Any> T.addTo(WindowedGui)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed May 21, 2024
1 parent 142fd09 commit d2e6d00
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion orx-jvm/orx-gui/src/main/kotlin/WindowedGUI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,10 @@ class WindowedGUI(
cw.program.extend(gui)
}
}
}
}

@JvmName("addToWindowedGui")
fun <T : Any> T.addTo(gui: WindowedGUI, label: String? = this.title()): T {
gui.add(this, label)
return this
}

0 comments on commit d2e6d00

Please sign in to comment.