Quote:
Originally Posted by Gunderak
I don't know how I would go about doing it using catchevent(); so il just stick with using an index for now.
|
Lets say I was going to create a GUI object which name includes an increasing number to distinguish itself:
PHP Code:
public function alert(temp.title, temp.message){
new GuiWindowCtrl("Alert_" @ thiso.alertcount) {
new GuiButtonCtrl("Alert_Button_" @ thiso.alertcount) {
//stuff
thiso.catchevent(this.name, "onAction", "buttonPress");
}
}
this.alertcount ++;
}
This would be creating a separate GUI control for each alert, where catchevent will then catch the specified action and pass the GUI object as a parameter within the specified function name:
PHP Code:
function buttonPress(temp.gui){
temp.gui.destroy();
}
I believe this can also be done without even assigning a GUI control a name.