<@U2RQ03PDW> You can bind Rectangle's height and w...
# tornadofx
a
@camdenorrb You can bind Rectangle's height and width to its parent.
Copy code
class ToolBar : HBox() {
    init {
        val rect = rectangle {
            fill = Color.RED
            reloadStylesheetsOnFocus()
        }
        prefWidth = 100.0
        prefHeight = 100.0
        rect.widthProperty().bind(widthProperty())
        rect.heightProperty().bind(heightProperty())
    }
}
I am not sure if there is a better TornadoFX way :')