Hello,
I think that the view dispatcher uses the index passed to view_dispatcher_add_view() to know which module to use for that view.
When you do scene_manager_next_scene() I believe the view dispatcher loads the module that was passed in ..._add_view().
You can see this because if you change the order of one of the two enums the application won't show anything. What's happening is that the ..._on_enter() function is building the elements in a module that the view dispatcher didn't load.
I think that in your case it's working just because it happens that the third value of the TestAppScene enum has the same module of the last value of TestAppView enum.
TL;DR
I think that the enum TestAppView is not needed and you should use values from TestAppScene in view_dispatcher_add_view(). Moreover you should do an ..._add_view() for each element of TestAppScene.
Hello, I think that the view dispatcher uses the index passed to
view_dispatcher_add_view()
to know which module to use for that view. When you doscene_manager_next_scene()
I believe the view dispatcher loads the module that was passed in..._add_view()
.You can see this because if you change the order of one of the two enums the application won't show anything. What's happening is that the
..._on_enter()
function is building the elements in a module that the view dispatcher didn't load.I think that in your case it's working just because it happens that the third value of the
TestAppScene
enum has the same module of the last value ofTestAppView
enum.TL;DR I think that the enum
TestAppView
is not needed and you should use values fromTestAppScene
inview_dispatcher_add_view()
. Moreover you should do an..._add_view()
for each element ofTestAppScene
.