onhide missing in v0.7.8b qwindow

1 view
Skip to first unread message

andy

unread,
Jun 23, 2010, 6:27:50 PM6/23/10
to Qutensil
hi, the onhide method in q.window is missing in v0.7.8b


andy

wonderingwout

unread,
Jun 24, 2010, 2:56:24 AM6/24/10
to Qutensil
Hi Andy,

In fact it's not, it is inherited from Q.Base.
It is not called 'onHide' but simply 'hide'.

The 'onShow' method in Q.Window is actually just a wrapper for the
'show' method in Q.Base.
Because Q.Window needs to call 'restack' on itself before showing it.

onShow: function() {
this.restack();

this.show();
}

All modules in Q are subclasses of Q.Base.
Therefore all methods are inherited and sometimes overwritten.

Wout

wonderingwout

unread,
Jun 24, 2010, 2:58:54 AM6/24/10
to Qutensil
I removed onHide because it was sitting there doing more or less the
same job as 'hide'.

andrew edmundson

unread,
Jun 24, 2010, 4:51:52 AM6/24/10
to qute...@googlegroups.com
Thanks for info. I have some code that needs to run when the window is hidden. How would I go about that without the onhide.


cheers

andy

wonderingwout

unread,
Jun 24, 2010, 5:11:36 AM6/24/10
to Qutensil
Well, you use the callback method to add your own functions:

var win = new Q.Window({
onHide: function(self) {
alert('I am hidden now');
}
});

Callback's reflect methods inside the class.
So for the hide method you have the onHide callback, show has
onShow, ...

andrew edmundson

unread,
Jun 24, 2010, 6:40:29 AM6/24/10
to qute...@googlegroups.com
Ahh Im getting it now, like how you've done that with the callbacks makes it more modular
Reply all
Reply to author
Forward
0 new messages