2022-09-01 07:55 PM
Hello all,
I dynamic create widget by 'new' and delete by 'delete', but the project crash when delete it.
Are there any examples of that used ?
I have 100 custom containers in a screen, but only one will be displayed at a time.
So I dynamic create one of these custom containers when used and delete when unused.
2022-09-02 03:11 AM
Hello @V.H ,
Could you please share your whole project ? Not only the UI files.
Thanks,
/Yoann
2022-09-05 10:39 PM
I upload my project, now. That's a little big so I just upload the UI file before.
This problem has been bothering me for a long time and has not been properly solved. Help me, please.
2022-09-07 10:54 PM
Any Ideas?
2022-09-21 02:23 AM
Hello @V.H ,
I investigated but didn't find the issue, your code seems correct to me.
After discussing with colleagues, they only said that it is not recommended to dynamically create widgets, because TouchGFX is allocating statically memory.
So, we strongly recommend people to create their widgets manually in TouchGFXDesigner, set them at non-visible and then show them at runtime.
We know that some customers like you have a lot of widgets they want to create dynamically, so we encourage instead at factorizing and reducing the number of widget, and then dynamically change the data displayed inside.
Hope that you will find a solution,
/Yoann
2022-09-21 06:28 PM
Hi @Yoann KLEIN
1, It create a screen with a button at system start;
2, Click the button to new a "Modal Window" with a gray image;
3, Click area without the the gray image to return then delete;
2022-09-25 05:20 PM
Hi @Yoann KLEIN
class Screen
{
......
Drawable* focus; ///< The drawable currently in focus (set when DOWN_PRESSED is received).
......
};
This was the root of the crash problem I think.
"focus" need clear to NULL when the "Modal Window" was been deleted.
Do you agree?
2023-03-20 09:09 AM