Skip to main content
Jtron.11
Senior
April 18, 2025
Solved

Same screen different texts and buttons enable

  • April 18, 2025
  • 1 reply
  • 1264 views

Hi all,

I am looking for advices to implement my GUI.  I have screen 1 with all the widgets. 

On this screen by default has:

1. The texts for Hours:Minutes:Seconds and a button to switch to setting screen to set the count down timer.

2. The switch mode button, to switch the timer 1 to timer 2.

Timer 1 has different texts and looks vs. timer 2.

The rest of the widgets on screen 1 stay exactly the same.

Currently, I have a solution buy copy exactly the same screen 1 and just replace the timer texts and button only, and using switch mode button to switch back and forth the screen 2 to screen 1 and vice versa.

I found this is wasting the memory resource and additional coding to handle different screens.

Question:

Is there a way I can use only screen 1 and change texts and button between timer1 vs. timer2?

Best answer by GaetanGodart

Hello @Jtron.11 ,

 

Please find attached an example of a project where clicking a button change the elements displayed without changing the screen.

 

Regards,

1 reply

GaetanGodart
Technical Moderator
April 23, 2025

Hello @Jtron.11 ,

 

To be clear, right now you have 2 screen that are very similar but with minor changes such as some textAreas and a button?
Then, you could simply keep a single screen and when you get your timer's interrupt, instead of changing the screen, et the textArea and the button invisible and set the other textArea and button visible (don't forget to invalidate).

 

Regards,

Jtron.11
Jtron.11Author
Senior
April 23, 2025

Jtron11_0-1745427330901.png

Hi @GaetanGodart ,

Yes, the major of 2 screens are exactly the same.  The only 2 items differences are two buttons and 5 text fields.

If I click Button A on main screen, I switch to setup screen, once I confirm the switch, I need my main screen to show "Button 1" and "Button2", and 3 text fields Text1, Text2, and Text3.

And vs. once I click Button 1 and confirm, I need the main screen to show Button A and Button B with 2 text fields Text X and Text Y.

GaetanGodart
GaetanGodartBest answer
Technical Moderator
April 24, 2025

Hello @Jtron.11 ,

 

Please find attached an example of a project where clicking a button change the elements displayed without changing the screen.

 

Regards,