Hello,
I wonder if I could get rid of 'Timer hacks' in my code. For example, consider
please 2 following pieces of code:
// #1
var pane = this.getViewPane(); // return HorizontalBoxLayout
pane.addEventListener('appear', function(e) {
qx.client.Timer.once(function(e) {
this.getChildren()[0].setHeight(this.getPreferredBoxHeight());
}, this, 500);
});
control.set({height: '100%', width:'1*'});
pane.add(control); // control is GroupBox
return pane;
// #2
var pane = this.getViewPane(); // return HorizontalBoxLayout
pane.addEventListener('appear', function(e) {
this.getChildren()[0].setHeight(this.getPreferredBoxHeight());
});
control.set({height: '100%', width:'1*'});
pane.add(control); // control is GroupBox
return pane;
The code #1 does the job although fails sometime (rarely). The code #2 never
does what I expect. The only difference is using delayed execution
(qx.client.Timer) in the second example. I read somewhere in the wiki that
using qx.client.Timer is hackish and should be avoided.
Could anyone please suggest the better solution?
Thanks,
Alexei Golovko
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel