Views
1 week ago

tornadofx-guide

7. Layouts and Menus The

7. Layouts and Menus The following code example shows how to use the ListMenu with the builder pattern: listmenu(theme = "blue") { item(text = "Contacts", graphic = Styles.contactsIcon()) { // Marks this item as active. activeItem = this whenSelected { /* Do some action */ } } item(text = "Projects", graphic = Styles.projectsIcon()) item(text = "Settings", graphic = Styles.settingsIcon()) } The following Attributes can be used to configure the ListMenu : 110

7. Layouts and Menus Attribute Builder- Attribute Type Default Description orientation yes Orientation VERTICAL Configures the orientation of the ListMenu . Possible orientations: VERTICAL HORIZONTAL iconPosition yes Side LEFT Configures the icon position of the ListMenu . Possible positions: TOP BOTTOM LEFT RIGHT theme yes String null tag yes Any? null activeItem no ListMenuItem? null Currently supported themes blue , null . If null is set the default gray theme is used. The Tag can be any object or null , it can be useful to identify the ListMenu Represent's the current active ListMenuItem of the ListMenu . To select a ListMenu on creation, just assign the specific ListItem to this property (have a look at the contacts ListMenuItem in the code example above.) Css Properties 111

GUIDE
GUIDE
Guide
Guide
Guide
GUIDE
GUIDE
Guide
GUIDE
GUIDE
GUIDE
GUIDE
GUIDE
Guide