2022-11-24 01:32 AM
Hi everyone,
I am a beginner in TouchGFX.
Right now I have created several containers with different buttons.
My goal is as follows:
When klicking a button of one container I want to change to another container.
So far I have found only the possibility to change between screens but not between containers.
Thanks in advance!
Antonia
2022-11-24 06:57 AM
Hello @ASteg.1 ,
Did you consider using a SwipeContainer ?
That could be a solution for you.
/Yoann
2022-11-24 10:47 PM
Yes I already thought about SwipeContainer, but first of all I can only change the container by swiping but I want to define a click button.
And second, I don't have one clear order how I want to go through my containers. Sometimes it depends on the clicked button to which container I want to go next.
2022-11-28 12:06 AM
If you created several containers, one solution could be to, after the click on your button, make the current container disappear but calling the function setVisible(false) and making the container you want appear on the screen but calling setVisible(true).
You will have to use interactions in TouchGFXDesigner to achieve that.
Hope that helps,
/Yoann
2022-11-28 06:48 AM
Thanks for the reply!
I have tried it, but now I have the problem that my button is inside of the FirstContainer. And I am only able to setVisible(false) the current FIrstContainer my button is in. But I don't find a way to reache out to the other SecondContainer and set it visible.
I have alredy tried to "get" the instance of the second container via code inside of my firstContainer.hpp but I don't find a function to modify my secondContainer.hpp inside of the first one.
I am thankful for any suggestions!
2022-12-01 12:51 AM
Does customContainer2.setVisible(true) not work ?
If you create a widget for each of your containers, they should all have a different name, and then you should be able to access them.
/Yoann
2022-12-06 05:03 AM
No customContainer2.setVisible(true) does not work, beacuase I am inside of my customContainer1 when defining my Button1press.
And customContainer1 does not now customContainer2. If I am trying it I get the error: "customContainer2" was not declared in this scope.
This is my setup and I want to define what happens after my buttonclick inside CustomContainer1: