2024-02-01 11:26 PM
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
2024-02-03 12:11 AM
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:
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
2024-02-11 11:21 PM
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
2024-02-12 11:43 AM - edited 2024-02-12 11:44 AM
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 :grinning_face_with_sweat:
Br JTP