|
From: Scott B. <sco...@se...> - 2001-05-17 05:40:26
|
If you have already registered an event listener on your class ignore the
following code. Otherwise, this is how you register an event listener
This code goes inside your class declaration.
---------------------------------------------------------------
this.events = new EventListener(this);
this.events.onresize = function(e) {
o = e.getTarget();
o."myfunction"(); <-- Insert function name here
};
this.addEventListener(this.events);
------------------------------------------------------------------
To create an event there are two ways you can do it.
a) You can set the size of your panel to its existing size
------------------------------------------------------
panel.prototype.setalign = function (align){// set caption align
this.align=align;
this.setSize(this.getWidth(),this.getHeight());
}
--------------------------------------------------------
or b) You can fire an event using the invokeEvent() method
(line 42ish in listeners.js)
---------------------------------------------------------
panel.prototype.setalign = function (align){// set caption align
this.align=align;
this.invokeEvent('resize');
}
----------------------------------------------------------
Hope this helps you.
Scott Bristowe
|