On 10/19/07, Dan <[EMAIL PROTECTED]> wrote:
>
> Can anyone explain me what I don't get about qooxdoo's layouts?
At least part of your problem is that centerToBrowser can't possibly work if
you call it when you instantiate the object. I needs to know the rendered
size of the object being centered, and it can't know that until AFTER it's
been rendered. That's why you need to call centerToBrowser in an event
listener for the "appear" event. That event is generated after the window
has been rendered.
Here's some working code for you to play with, based on the skeleton which
it appears you're familiar with.
qx.Class.define("custom.Application",
{
extend : qx.application.Gui,
members :
{
main : function()
{
this.base(arguments);
var w = new qx.ui.window.Window("Login");
w.set({
showClose : false,
showMinimize : false,
showMaximize : false,
resizable : false
});
var vLayout = new qx.ui.layout.VerticalBoxLayout;
vLayout.auto();
vLayout.set({
top : 5,
left : 5,
bottom : 5,
right : 5,
spacing : 4,
padding : 2
});
var label = new qx.ui.basic.Label("Foo");
vLayout.add(label);
label = new qx.ui.basic.Label("Bar");
vLayout.add(label);
w.addEventListener("appear",
function()
{
this.centerToBrowser();
},
w);
w.add(vLayout);
w.open();
w.addToDocument();
},
close : function()
{
this.base(arguments);
},
terminate : function()
{
this.base(arguments);
}
},
settings :
{
"custom.resourceUri" : "./resource"
}
});
Derrell
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel