onunload method

4 views
Skip to first unread message

thomas

unread,
Jul 25, 2008, 6:47:53 AM7/25/08
to porcupine-users
There are many times when the existence of the above method for some
widgets, especially boxes, would have saved me from a lot of coding.

How feasible is the implementation of such a method?

Thanks

tkouts

unread,
Jul 25, 2008, 11:28:45 AM7/25/08
to porcupine-users
This should be a base widget method. I think this should be
implemented by adding a specific custom event handler that gets fired
just before destroying each widget (thus we're gonna have an
"onunload" custom event). I think it would be fairly easy to
implement.

Thomas Bellos

unread,
Jul 28, 2008, 2:30:20 AM7/28/08
to porcupi...@googlegroups.com

So here is an implementation of the onunload event:

Widget.prototype.destroy = function(w) {
var w = w || this;
if(w._customRegistry['onunload'])
w._customRegistry['onunload'](w);
QuiX.removeWidget(w);
}

And

Widget.prototype.customEvents = ['onload','onresize','ondrop','onunload'];

tkouts

unread,
Aug 8, 2008, 4:15:03 AM8/8/08
to porcupine-users
Thanks Thomas. This seems valid enough. I merged this in the Porcupine
trunk. So it seems that our widgets have a new custom event :).
Reply all
Reply to author
Forward
0 new messages