cancel
Showing results for 
Search instead for 
Did you mean: 

Static liveness of touchGFX objects when switching screens

CKörn.2
Associate II

Hello,

how can I simply achieve touchGFX objects (sliders, on/off button etc.) to remain their state when I added a functionlity to switch the screen layer. More precisely I want to keep my adjusted values (slider etc.) in their state after switching to anther screen and back.

How can I program that without getting too deep into objective programming with getters/setters?

Thank you in advance and kind regards

2 REPLIES 2
ktrofimo
Senior III

Depending on how you are going to keep values between View sessions. If you do have many variables you can organize them as a single struct. This struct can be a member of a class for keeping settings as well as storing and loading them. Then, access to this struct you can make with a get() and set() methods of a Settings class.

CKörn.2
Associate II

Thank you!

Yeah actually it would be nice to have a smarter solution to this issue because things are getting exhausting of i have to program every screen switch and its states manually.

In this particular case it somehow stores the variables the screen objects hold however the objects (for example toggle button) jump into their default state.