Hi.
I've got a problem with timing in 0.8.
If I try to set dimensions (height/width) and positions (left/top) of a
widget and directly calling a built-in qooxdoo method I don't get the result
I want.
I'll try to explain this by an example. I have a minimal application with
one window and some buttons. On execute the height and width of the window
will be set, the window will be centered (using center()-method) and finally
the window is opened. All three buttons will set different height/width. The
third button has a timer on the center-call.
Case I:
Click first button. Window opens centered with correct dimensions. Click
second button (doesn't matter whether you close window between). The window
is now opened with correct dimensions but is centered according to the old
dimensions (set when executing first button).
Case II:
Case I in reverse. Click second button followed by first button. Result is
same as case I; dimensions ok, centering is based on the first execution.
Case III (my workaround):
Click first button. Then click third button. When I added a timer on
centering in the execute it does as intended. The result is as intended.
By this, my questions are: Why is this happening (case I+II)? Is there
another way to do this? Flushing before calling internal method?
Eksample code:
var win = new qx.ui.window.Window("Test window");
this.getRoot().add(win);
var testBtn1 = new qx.ui.form.Button("First");
testBtn1.addListener("execute", function(e) {
win.set({
height : 200,
width : 300
});
win.center();
win.open();
});
var testBtn2 = new qx.ui.form.Button("Second");
testBtn2.addListener("execute", function(e) {
win.set({
height : 400,
width : 600
});
win.center();
win.open();
});
var testBtn3 = new qx.ui.form.Button("Third (w/timer)");
testBtn3.addListener("execute", function(e) {
win.set({
height : 600,
width : 900
});
qx.event.Timer.once(function(e) {
win.center();
}, win, 1);
win.open();
});
this.getRoot().add(testBtn1, {left: 10, top: 10});
this.getRoot().add(testBtn2, {left: 80, top: 10});
this.getRoot().add(testBtn3, {left: 10, top: 50});
--
View this message in context:
http://www.nabble.com/Timing-problem-in-0.8-tp19990514p19990514.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel