View Single Post
  #11  
Old 12-09-2011, 06:45 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Gunderak View Post
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.titletemp.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.

Last edited by ffcmike; 12-09-2011 at 07:19 PM..
Reply With Quote