fun Accordion.fold(title: String? = null, op: (Pane.() -> Unit)? = null): TitledPane { val vbox = VBox() op?.invoke(vbox) val fold = TitledPane(title, if (vbox.children.size == 1) vbox.children[0] else vbox) panes += fold return fold }