anidotnet
08/01/2018, 6:54 AMclass MainView : View("Hello TornadoFX") {
override val root = hbox {
label(title) {
addClass(Styles.heading)
}
button ("Second View") {
setOnAction {
find<SecondaryView>().openWindow(StageStyle.DECORATED)
}
}
}
override fun onDock() {
super.onDock()
currentStage!!.setOnShown {
println("MainView $it")
}
}
}
class SecondaryView : View("Hello Secondary View") {
override val root = hbox {
label(title) {
addClass(Styles.heading)
}
}
override fun onDock() {
super.onDock()
currentStage!!.setOnShown {
println("Secondary $it")
}
}
}
Any idea why I can't listen to stage shown event for other stages?