(I see the "Setting Up" so the init of the view is...
# tornadofx
b
(I see the "Setting Up" so the init of the view is executed). i tried with background and application thread, and also with no parameter for the FXEvent.
Problem was due to the use of View() instead of find<View>() . I have no idea why it change anything in that case, but it works now.
e
You must never instantiate UICompoenents manually. They need to be injected or found, or else they will not receive all life cycle callbacks.
b
make sense now. regarding injection, it is only useful if I need to refer to the view itself ?
e
Yeah, normally you'd just do
add<MyView>()
where you want to add it to the existing UI, or
find<MyView>().openModal()
if you need to open it in a new window.
👍 1