From 81ce0ad9b262b925caafc15774fc7c1813af3401 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Sun, 16 Feb 2020 23:08:18 +0100 Subject: [PATCH] Change loadParameters, saveParameters to be public, add label to addTo --- orx-gui/src/main/kotlin/Gui.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/orx-gui/src/main/kotlin/Gui.kt b/orx-gui/src/main/kotlin/Gui.kt index a8020e01..b8d79246 100644 --- a/orx-gui/src/main/kotlin/Gui.kt +++ b/orx-gui/src/main/kotlin/Gui.kt @@ -399,7 +399,7 @@ class GUI : Extension { var textValue: String? = null) - private fun saveParameters(file: File) { + fun saveParameters(file: File) { fun KMutableProperty1?.qget(obj: Any): T { return (this as KMutableProperty1).get(obj) } @@ -421,7 +421,7 @@ class GUI : Extension { file.writeText(Gson().toJson(toSave)) } - private fun loadParameters(file: File) { + fun loadParameters(file: File) { fun KMutableProperty1?.qset(obj: Any, value: T) { return (this as KMutableProperty1).set(obj, value) } @@ -584,7 +584,7 @@ class GUI : Extension { } @JvmName("addToGui") -fun T.addTo(gui: GUI): T { - gui.add(this) +fun T.addTo(gui: GUI, label:String? = this.title()): T { + gui.add(this, label) return this } \ No newline at end of file