Assigning message handlers by script
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Assigning message handlers by script
Hello! I am still quite new to Revolution but I am beginning to appreciate it more and more. Coming from traditional programming I had to get used to some of the concepts - but surprisingly it showed that most of the time things worked exactly the way I was thinking about them.
Now I have a problem that I cannot solve on my own. It might be easy or obvious but I can't find anything about it in the documentation:
I am writing a program where some multiple choice options are presented in form of buttons (between 5 and 50) on an extra stack. I create these buttons at runtime dynamically. So far everything is fine. But I want the buttons to react when you click them. So I need to assign some "on mouseDown" script to each of these newly created buttons. How can I do this by script? Or - can I do this at all? If not - which would be the alternative?
Help is very appreciated. Thank you in advance.
Kroka
Now I have a problem that I cannot solve on my own. It might be easy or obvious but I can't find anything about it in the documentation:
I am writing a program where some multiple choice options are presented in form of buttons (between 5 and 50) on an extra stack. I create these buttons at runtime dynamically. So far everything is fine. But I want the buttons to react when you click them. So I need to assign some "on mouseDown" script to each of these newly created buttons. How can I do this by script? Or - can I do this at all? If not - which would be the alternative?
Help is very appreciated. Thank you in advance.
Kroka
"irgendwas is immer"
By trying out and reading some of the posts here I came to a solution which is not exactly what I was thinking of but it works for my purpose.
I just assigned a "mouseUp" handler to the card script which analyzes the target and distinguishes the buttons by their labels to react differently for each type of button.
As far as I understand this would be the common way to deal with such things. Am I right? As usual - simple but powerful.
I just assigned a "mouseUp" handler to the card script which analyzes the target and distinguishes the buttons by their labels to react differently for each type of button.
As far as I understand this would be the common way to deal with such things. Am I right? As usual - simple but powerful.
"irgendwas is immer"
Hey kroka,
exactly. If you need to do such sort of dynamics, place the script in the card, stack or a library. You could set the script of a button, however that might bit you when it comes to compile time. As soon as you use more than 10 statements in the script you set in a standalone, the scriptlimits will bite you and it will not compile.
Cheers,
Malte
exactly. If you need to do such sort of dynamics, place the script in the card, stack or a library. You could set the script of a button, however that might bit you when it comes to compile time. As soon as you use more than 10 statements in the script you set in a standalone, the scriptlimits will bite you and it will not compile.
Cheers,
Malte
Und Grüße!
Hast Du schon das deutsche Revolutionboard gesehen?
http://www.revolutionboard.de
Gruß,
Malte
Hast Du schon das deutsche Revolutionboard gesehen?
http://www.revolutionboard.de
Gruß,
Malte
http://revolutionboard.de/smf/index.php?topic=98.0 is hilarious!
Hi Malte,
Please advice on this script limits and where/how the apply to a standalone application.
Kroka, Please check the scipt anatomy discussions @
http://support.runrev.com/scriptingconferences/ contains some details on how to dynamically assign script to objects at runtime.
Please advice on this script limits and where/how the apply to a standalone application.
Kroka, Please check the scipt anatomy discussions @
http://support.runrev.com/scriptingconferences/ contains some details on how to dynamically assign script to objects at runtime.
Build 160
Version 2.9.0
Platform: Windows
Version 2.9.0
Platform: Windows