File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
orx-jvm/orx-gui/src/main/kotlin Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ class WindowedGUI(
16
16
val windowAlwaysOntop : Boolean = false ,
17
17
) : Extension {
18
18
override var enabled: Boolean = true
19
+ val gui: GUI = GUI (appearance, defaultStyles)
19
20
20
21
private val addedObjects = mutableListOf<Pair <Any , String ?>>()
22
+
21
23
fun <T : Any > add (objectWithParameters : T , label : String? = objectWithParameters.title()): T {
22
24
addedObjects.add(Pair (objectWithParameters, label))
23
25
return objectWithParameters
@@ -58,9 +60,8 @@ class WindowedGUI(
58
60
59
61
// launch because at this stage Driver.instance.contextID points to the context of the parent window
60
62
cw.program.launch {
61
- val gui = GUI (appearance, defaultStyles)
62
- for (o in addedObjects) {
63
- gui.add(o.first, o.second)
63
+ for ((obj, label) in addedObjects) {
64
+ gui.add(obj, label)
64
65
}
65
66
cw.program.extend(gui)
66
67
program.produceAssets.listen {
You can’t perform that action at this time.
0 commit comments