09.04.2018 Views

tornadofx-guide

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7. Layouts and Menus<br />

squeezebox {<br />

fold("Customer Editor", expanded = true) {<br />

form {<br />

fieldset("Customer Details") {<br />

field("Name") { textfield() }<br />

field("Password") { textfield() }<br />

}<br />

}<br />

}<br />

fold("Some other editor", expanded = true) {<br />

stackpane {<br />

label("Nothing here")<br />

}<br />

}<br />

}<br />

Figure 7.17<br />

A Squeezebox showing two folds, both expanded by default<br />

You can tell the SqueezeBox to only allow a single fold to be expanded at any given time by<br />

passing multiselect = false to the builder constructor.<br />

You can optionally allow folds to be closable by clicking a cross in the right corner of the title<br />

pane for the fold. You enable the close buttons on a per fold basis by passing closeable =<br />

true to the fold builder.<br />

114

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!