cancel
Showing results for 
Search instead for 
Did you mean: 

toggle button positon set at inialt level when we change the screen.

Ranjeet Singh
Senior

0693W00000Y83I5QAJ.pngif i will change this codition to "off" state during program excuation it will change to "off" .but when i change screen to another screen the position is came to starting point "on".

how i solve this ?0693W00000Y83JDQAZ.png0693W00000Y83JDQAZ.png

1 ACCEPTED SOLUTION

Accepted Solutions
Yoann KLEIN
ST Employee

Hello @Ranjeet Singh​,

You will have to save the state of your toggle buttons (with a boolean variable for example) in the Model, and then read this value every time you switch back on your Screen (in the setupScreen() method inside ScreenView.cpp).

To do that, you can take a look at this article of our documentation, and also this one for a simple tutorial.

Moreover, you can try out the project I shared in this post.

It can help you understand how to save value in the model from the View and propagate values the other way.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX

View solution in original post

5 REPLIES 5
Yoann KLEIN
ST Employee

Hello @Ranjeet Singh​,

You will have to save the state of your toggle buttons (with a boolean variable for example) in the Model, and then read this value every time you switch back on your Screen (in the setupScreen() method inside ScreenView.cpp).

To do that, you can take a look at this article of our documentation, and also this one for a simple tutorial.

Moreover, you can try out the project I shared in this post.

It can help you understand how to save value in the model from the View and propagate values the other way.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX

ok thank you sir,i will try

Hi @Yoann KLEIN​ ,

I started to use TouchGFX few days ago and it took me a while to understand that there is only 1 Model for the whole GFX (I come from Qt world so had to readjust to GFX's use of Model concept). I think it would help a lot if this was emphasized in docementation a bit more eg:

0693W00000Y8dtMQAR.png 

Or as it is done in this document:

www(dot)e4ds(dot)com/prom/files/Quest_5_Material.pdf

0693W00000Y8duKQAR.png 

Ferro

Hello @ferro​,

Thanks for the input, I will report this element to my colleagues.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX

sir,can we transfer touch gfx screen data to our monitor through any protocol..?