Quote:
Originally Posted by Liberated
What doe catchEvent() do?
I was already wondering if there wasn't an easier way btw.
|
catchevent(str, str, str) - adds an event handler for the specified object name and event, third parameter is the name of the function which receives the event (first parameter of the event will be the object for which the event occured)
http://wiki.graal.net/index.php/Crea...ient/TGraalVar
PHP Code:
//in button creation
catchEvent(this, "onAction", "buttonPressed");
//later
function buttonPressed(obj) { //obj is the object caught
//stuff
}
Doing simple checks (probably easiest to use obj.text) inside buttonPressed() will determine what to do.
Example:
PHP Code:
if (obj.text in |0, 9|) {
this.number1 @= obj.text;
}