Add onChangeEventListener for ParameterType.Option in Gui (#292)
This commit is contained in:
@@ -25,6 +25,9 @@ fun main() = application {
|
|||||||
|
|
||||||
gui.add(settings)
|
gui.add(settings)
|
||||||
extend(gui)
|
extend(gui)
|
||||||
|
gui.onChange { name, value ->
|
||||||
|
println("$name: $value")
|
||||||
|
}
|
||||||
extend {
|
extend {
|
||||||
when (settings.option) {
|
when (settings.option) {
|
||||||
BackgroundColors.Pink -> drawer.clear(ColorRGBa.PINK)
|
BackgroundColors.Pink -> drawer.clear(ColorRGBa.PINK)
|
||||||
|
|||||||
@@ -730,6 +730,8 @@ class GUI(
|
|||||||
obj,
|
obj,
|
||||||
it.value.data as? Enum<*> ?: error("no data")
|
it.value.data as? Enum<*> ?: error("no data")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
onChangeListener?.invoke(parameter.property!!.name, it.value.data as? Enum<*> ?: error("no data"))
|
||||||
}
|
}
|
||||||
getPersistedOrDefault(
|
getPersistedOrDefault(
|
||||||
compartment.label,
|
compartment.label,
|
||||||
|
|||||||
Reference in New Issue
Block a user