Skip to main content
wu ryan
Associate II
September 20, 2019
Question

Custom container with button to call virtual fuction

  • September 20, 2019
  • 1 reply
  • 1395 views

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. : )

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
September 23, 2019

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