cancel
Showing results for 
Search instead for 
Did you mean: 

Hour and minutes

StefanoL
Associate III

Good morning , sorry if i'm not posting in the right place but i'm still learning. I have a problem with an example i saw in the tutorial where you bild an iterface to adjust the hour and minutes . In the tutorial where i built the interface it says to copy the code and put it in two files .... i tired but when i press the buttons mothing happens and in the two text areas thereare two question marks. Could someone kindly help me? Thank you so much. 

16 REPLIES 16

Ok i understood where i was wrong , now the meters work. You were very kind

My pleasure! 🙂

Gaetan Godart
Software engineer at ST (TouchGFX)

 If I can I still take advantage of the availability. Can I make it so that this clock can also be used in other applications without having to build it all the time in each new project? Thanks

Yes you can do that.

 

You will have to create a custom container (also called a custom widget) : custom widgets 

 

To do so, you basically have to create your clock inside a custom container :

GaetanGodart_0-1707747951361.png

Once you are done, right click on the name of your custom container and click export :

GaetanGodart_1-1707748022884.png

Make sure to change the name of the typography you will use (don't keep it called "default") otherwise you will have errors when importing it from another project.

Once you exported your custom container, it will be saved as a .tpkg file in your project's folder.

Finally, you can import it in another project by clicking edit, import and then custom container :

GaetanGodart_3-1707748162754.png

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

ok thanks a lot. I'll try

 You are really very prepared...... you already know all the problems I will face. I already noticed that I had to change the names in the typography. I noticed that when I launch the simulator in the custom container I have no errors but the screen remains black. if I export it and then import it into a project it shows correctly. Is this normal, am I doing something wrong? Thanks so much and have a good day

Hello @StefanoL ,

It is good habit to post only one question per thread. If you have a new question you should create a new thread.

 

When you have a black screen, are you sure you have something on your screen1?
If you created your clock in a custom container and then run, you won't see your clock. You need to go to your screen and then add the custom container you created just like you would add any widget (ex: button, box, text area).
If you did that and you have a black screen, try adding something else to your screen (like a green box) and see if it is still black.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)