09.04.2018 Views

tornadofx-guide

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Workspaces<br />

Drawer navigation<br />

The Workspace has built in support for the Drawer control. You can access<br />

workspace.leftDrawer and workspace.rightDrawer to add items to each drawer. They will<br />

show up on either the left or right side whenever you have added one or more items to them.<br />

Items added from a View in onDock will automatically be removed when the View is<br />

undocked. Items added directly in the Workspace subclass, from the onBeforeShow App<br />

callback or from any other place will stay until they are manually removed.<br />

The combination of static and dynamic drawer items makes for a very powerful navigation<br />

and menu structure. Only your imagination is the limit!<br />

The following example creates a customize Workspace primed with a docked Customer<br />

Editor in the editor area and the three drawer items we created in the Drawer chapter<br />

configured statically in the leftDrawer of the Workspace:<br />

242

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

Saved successfully!

Ooh no, something went wrong!