cancel
Showing results for 
Search instead for 
Did you mean: 

Custom trigger

lclor
Associate III

Hello,

 

Is it possible to create a custom trigger for box shape?

I would like to move the box using interaction, but I would like to trig this interaction from source code, is it possible?

 

Thanks,

Best regards,

Laurent

3 REPLIES 3
JTP1
Lead

Hello

If you place the box to the customContainer, then it is possible to use trigger - action mechanism.

You can also get clicked- event from box placed directly to the screen if you set ClickListener on in the mixins settings.

This exact  method is descripted in Tgfx documentation:

https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/mixins#callback-implementation-in-user-code-2

Maybe the simplest solution would be to use normal button-widget and set png picture of your box to it. Then implement 'button is clicked'- interactions and place code that moves the widget there. Or even set Interaction -> action to 'move Widget' so then code is not even needed. But with this way you get only single movement.

It depends what you need...maybe tell bit more.

Br Jtp

lclor
Associate III

thank you for your help.

 

maybe, in next release, we could have the possibility to add custom trigger (trig from code) for the widgets, that could add a lot of functionalities without written lot of code.

 

Best regards,

Laurent

 

Hello

Glad to hear it helped you.

This is an excellent idea to add automation for generating callbacks to view- base class for widgets. I think for most users, me included, it's bit pain to manually add callback mechanism 😅

Br JTP