cancel
Showing results for 
Search instead for 
Did you mean: 

using custom container on multiple page

BCabo.1
Associate

I am trying to use a custom container to create a master menu button list to change pages, it looks like it is all working but when the toggle button from the custom container are selected to change page it reset to default states when i change page.

Basically the custom container do not keep it own states when page are change but it reset itself every-time a page is change.

Is there a way to change this without but using touch GFX only?

Thanks

3 REPLIES 3
Jagdish Bisawa
Associate III

Hi @BCabo.1​ ,

It seems that the issue you are facing is that when you move from one screen to another & back to the first screen, the state of the first screen is not maintained.

The TouchGFX framework does not retain the state of your widgets when switching between screens. This essentially means that when a screen is switched, it does not stay in memory & is created afresh when jump to it. This is done to maintain a low memory footprint.

To address this problem, you can maintain the state of your widget in your code variables & retain the drawn state in the setupscreen function of the concerned screen/view.

/Jagdish Bisawa

Hi @Jagdish Bisawa​ 

Thank you for your answer, May I ask one more question? Do you know if there is a way to move a widget in a scrollable container using the X Y reference to the the scrollable container and not the XY of the page?

Thanks

Ben

Jagdish Bisawa
Associate III

Hi @BCabo.1​ ,

I am not sure on this one. May be going through the API might help.

As far as I know most of the X,Y positions are with respect to the parent, not the display origin. You might have to try something & conclude.

/Jagdish Bisawa