Hi. How do I bind the result of a non-observable f...
# tornadofx
w
Hi. How do I bind the result of a non-observable function to a property? as I understand it, I'd need a ChangeListener for that?
b
can give an example of what you want to do. If you want to perform an action when a property changes, then you need
Copy code
property.onChange { newValue -> } // it
// or
// property.addListener(ChangeListener { ob, old, new -> })
w
Copy code
private val isConnectedProperty = SimpleBooleanProperty()
private val isConnectedBinding = booleanBinding(isConnectedProperty) { radioController.isStarted() }
So I need to bind various UI elements to whether radio controller has finished starting up or not
b
the function in isConnectedBinding will not work without changing the isConnectedProperty