I am trying to subscribe to the WINDOW_SHOWN event...
# tornadofx
a
I am trying to subscribe to the WINDOW_SHOWN events for all stages. But I can do it only for the primary stages but not for any other stages I create from it.
Copy code
class 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?