问题描述
我的 MainView 有一个带左侧菜单的边框。左边的菜单是 vbox 里面有按钮的 hbox(s)。我希望能够点击每个按钮和bordpane的CenterView切换到相应的视图。
/**
* An Hbox with a button
*/
hbox {
button {
addClass(Styles.leftMenuButtonsStyle)
this.text = " Dashboard >"
imageview("dashboard.png").apply {
addClass(Styles.leftMenuIconsStyle)
fitHeight = 25.0
fitWidth = 25.0
}
action {
print("Dashboard button is clicked!!")
find<CenterView>().replaceWith(find<UsersView>())
}
}
}
/**
* An Hbox with a button
*/
hbox {
button {
addClass(Styles.leftMenuButtonsStyle)
this.text = " Test Repository >"
imageview("Image1.png").apply {
addClass(Styles.leftMenuIconsStyle)
fitHeight = 25.0
fitWidth = 25.0
}
action {
print("Tes_Repository button is clicked!!")
find<CenterView>().replaceWith(find<NotificationsView>())
}
}
}
以下是应用程序的外观
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)