Heyho, quick and hopefully simple question: I have...
# tornadofx
n
Heyho, quick and hopefully simple question: I have an observable list as my model. I want to paint a circle for each item in the list and refresh (add circles) when there are new Items in the list. Is there a way to achieve this with some kind of "fake control" where I bind the list? Or do I need to add my own change listener to the list and update the UI? Thanks!
Found it 🙂
Copy code
pane {
    bindChildren(nodes) { node ->
        circle  {
            centerXProperty().bind(node.posXProperty)
            centerYProperty().bind(node.posYProperty)
            radius = 10 * node.weight
            fill = Color.BLUE
            opacity = 0.5
            setOnMouseEntered { name.value = node.name }
            setOnMouseExited { name.value = "" }
        }
    }
}