cancel
Showing results for 
Search instead for 
Did you mean: 

Widgets are redrawn after invalidate, how not to?

JPabl.1
Senior

Hi there Touchgfx team!

 

I have these screens

JPabl1_0-1729084934253.png

I already implemented all the navigation. When I'm in volume screen, if I start pressing the up/down arrow buttons, the read widgets appears again. Is there any way to avoid this different than calling invalidate() every single time? 

All those 4 screens are developed inside a single screen. Based on the user input, I just change their state to visible/invisible. 

Thanks a lot in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @JPabl.1,

As you mentioned, you just need to change the visibility state of the READ widget. There should be a misconfiguration in your logic that causes the READ widget appear if the up/down buttons are pressed. You can also call invalidate() only for the widgets you are changing (instead of the whole screen, which can save a lot of unnecessary calculations).

So please, ensure you are using SetVisible(bool visibility) in the correct order. If you still have issues, please share the part of your code that is causing the issue. 

I hope this helps you!

 

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

3 REPLIES 3

Hello @JPabl.1,

As you mentioned, you just need to change the visibility state of the READ widget. There should be a misconfiguration in your logic that causes the READ widget appear if the up/down buttons are pressed. You can also call invalidate() only for the widgets you are changing (instead of the whole screen, which can save a lot of unnecessary calculations).

So please, ensure you are using SetVisible(bool visibility) in the correct order. If you still have issues, please share the part of your code that is causing the issue. 

I hope this helps you!

 

Mohammad MORADI
ST Software Developer | TouchGFX
JPabl.1
Senior

I missed a invalidate() call, thanks

Glad to hear you have fixed it :D

You're very welcome!

Best regards,

Mohammad MORADI
ST Software Developer | TouchGFX