Even if a image appears it does not mean that it is loaded all. Better
than relying on the widget system for any preferred width is to ask the
preloader for the size.
getInnerWidth/getInnerHeight/getBoxWidth/getBoxHeight etc. should also
be seen a private as they may have a bad influence on the layout system.
var img = qx.io.image.PreloaderManager.getInstance().create(imageSrc);
img.addEventListener("load", function(e) {
alert(this.getWidth() + "x" + this.getHeight());
});
To precalculate dimensions using the layout system is currently a bad
idea. We will hopefully improve this with 0.8 but until then please omit
any usage of getInner* or getBox* as mentioned above. Especially when
the element is not yet layouted correctly.
Alternatively you can use a BoxLayout, put the textField left, the
button right and place a flexible element between them. Then you could
define a minWidth=auto for the BoxLayout and even define a minWidth for
the flexible part.
Sebastian
Dietrich Streifert schrieb:
> Hello List,
>
> I want to create a widget which is a qx.ui.layout.CanvasLayout which
> contains a text field and a button.
>
> The button should stay at the right side of the canvas ( setRight(0) ),
> the text field should stay at the left side ( setLeft(0) ).
>
> The right side of the text field should be a few pixels from the left
> side of the button.
>
> The widget should be settable to left:0 and right:0 and be resizable
> within eg. a window.
>
> To achieve this I need to calculate the width of the button. I tried to
> attach a "appear" event to the button and retreive the width via
>
> button.getInnerWidth();
>
> Unfortunately this returns different widths in IE and FF.
>
> After some investigations it turned out that the the getInnerWidth
> method of the icon returned 0 in FF and 16 (as expected) in IE.
>
> Is this a bug?
>
>
> Thank you for your help.
>
> Regards.
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel