Ok thanks Fabian, I think I can live with this solution for the moment! :-)

Fabian Jakobs a écrit :
Charlie schrieb:
Ok, I think I auto-solved my problem, digging the framework codes, I end up overriding the _changeInnerWidth() method to trigger my own "innerWidthChanged" event on the TabLayout. Is it the right way this time? More, why does the code of this function *must *be in a window.setTimeout(...., 0) ?
Thanks
Charlie

There is no clean way to detect layout resize events. The way you do it is the cleanest hack to detect them. The timeout is necessary because the method _changeInnerWidth() is called during the layout flush. If you do any modification, which influences the layout, the whole mechanism may break. The timeout ensures that all changes are applied after the layout flush.

In 0.8 there will be a "resize" and "move" event but until then you will have to live with this solution.

Best Fabian

BTW
This is definitely no dummy question :-)


Charlie a écrit :
Hi
once again, i hope i'm not asking a too dummy question...
Here is my generic problem : what is the approach to detect a "resize" event of a Widget inside a complex layout?

I explain my case :
I've developped an extended TabLayout that can hide some tabs if there are too many to be displayed for the width of the bar, and show the hidden ones in a popup menu (exactely like the FF personal toolbar, with the arrows button at the end.). For this, I have a handler that computes what should be displayed or not, depending on the tab bar "widthValue". Naturally, if the user resizes the browser window, or in my case any splitpane impacting on the TabLayout width, I have to trigger the handler to recompute the tabs. Since my TabLayout width property is set to '100%', i cannot observe the "changeWidth" property on this, it never changes. And there is no event like "changeWidthValue", so I find myself using a recursive function searching for the first parent that has a "width" property that is not a percentage, then attach a listener to it to check if the width is changing.

It's working, but I'm quite sure this is not a really clean approach, is it? Could you tell me how to do this in a better way?
Thanks again for the work
Charlie

-------------------------------------------------------------------------
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
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------

-------------------------------------------------------------------------
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
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



-------------------------------------------------------------------------
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
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to