-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LVGL] Separate objects
struct by screen
#646
Comments
TouchGFX has a good way of structuring the parent child hierachy of widgets and screens. I think the auto generated structure supports larger projects better since it directly integrates a model view presenter approach. Would something similar be doable for this program? |
I agree that currently generated code where we put all the widgets in the single structure is not ideal not only for the larger projects, but also for the user widgets. For example, here is how user widget create function looks like:
If we move each screen and user widget objects to separate structures, we will have this:
So, instead of:
we will have more elegant code:
There are some technical difficulties:
|
Is your feature request related to a problem? Please describe.
I am relatively new to LVGL so I may misunderstand the workflow, please correct me if this is correct.
Currently all named widgets, or widgets used in a flow, have a pointer saved in the
objects
variable inscreens.c
. I think it would be beneficial for more complex UIs to have the widgets separated by the screen they are onDescribe the solution you'd like
This could be a struct per screen containing pointers to all the widgets used in that screen.
So instead of this in
screens.h
:You would have something like this:
Describe alternatives you've considered
In my opinion this structure provides easier access to the widget pointers while not adding significant additional memory usage. However it does not keep the full parent child structure of widgets which would be even better.
The text was updated successfully, but these errors were encountered: