cancel
Showing results for 
Search instead for 
Did you mean: 

Custom container with button to call virtual fuction

wu ryan
Associate II

Hi everyone, I try to make a custom container from TouchGFX Designer and I would like one of button in the container to call a function in view class. After generating code, I saw that the button call back is already generated and call the function name that I config with blank execution. However, I don't know how to implement or over ride the function in view class.

I want use a Custom container with button to change textarea , I have two Custom container with button in my screen1 , If I Click button1 then the textarea will show "button1 ", If I Click button2 then the textarea will show "button2 " .

button1 and button2 is custom container.

I read the Knowledge Base before,but I only need a button not like the example is a model window with two button.

https://touchgfx.zendesk.com/hc/en-us/articles/205575842-Creating-custom-containers

My English is not very will ,If there's anything you haven't understood, please tell me.

Thanks you and have a good day. : )

1 REPLY 1
Martin KJELDSEN
Chief III

Hi,

You can get this done by specifying a callback for your custom container and tying a handler (defined in your view) to it. This makes it portable across views. You can get some inspiration from Button (for which you have the source code). You'll find plenty of demos/exampels that use buttons and set callbacks and handlers for them.

Let me know.

/Martin