execute script clicked

Find and share HowTos to various installations / configurations!
5 posts • Page 1 of 1
marcel.gay@wimag.ch
Posts:62
Joined: Thu May 07, 2015 6:55 pm

execute script clicked

Post by marcel.gay@wimag.ch »

I have an animation which shows and hides a sidemenu, this can be shown or hidden with a mouse click
On the same page I have a combobox, a selection point should also open the sidemenu, that means the function like a mouse click on the sidemenu

How can I trigger a script (in this case the script under "clicked") from another element with this script?

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: execute script clicked

Post by kilianvp »

You can't do a button click via script. But you can put your code from click in a own function and call the function instead

marcel.gay@wimag.ch
Posts:62
Joined: Thu May 07, 2015 6:55 pm

Re: execute script clicked

Post by marcel.gay@wimag.ch »

Unfortunately, this does not work because local variables are used
The script is with an animation from a button, but I want to trigger the function from a combo box on the same page
And if I change the function, I have to make sure that I do not forget the second change, with an external call eliminates this problem

How can I trigger a script (in this case the script under "clicked") from another (selected Line from Combobox) element with this script?

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: execute script clicked

Post by leoknipp »

If you want to execute the same functions you can
-- define a library function in a CTRL library saved in scripts/libs
-- call the function at the Clicked event of the button
-- in the ComboBox when the item is selected

Best Regards
Leopold Knipp
Senior Support Specialist

gschijndel
Posts:376
Joined: Tue Jan 15, 2019 3:12 pm

Re: execute script clicked

Post by gschijndel »

Another option would be to:
  • define an event
  • connect to this event
  • trigger this event
The benefit of using an event is that the script context is the same regardless of from where the event is triggered.

5 posts • Page 1 of 1