bingo!
that did it.
of course it sounds all very logical if you know the right way.
for completeness: code now looks like this:
var doc = this.getRoot();
var scrollContainer= new qx.ui.container.Scroll();
doc.add(scrollContainer, {top: 0, left: 0, right: 0, bottom: 0});
this._mainvb= new qx.ui.container.Composite(new qx.ui.layout.VBox(5));
this._mainvb.setBackgroundColor("#FFFFFF");
scrollContainer.add(this._mainvb);
Thanks all for helping me out.
Farid
On Thu, Dec 18, 2008 at 2:25 PM, Christian Schmidt
<[email protected]> wrote:
> Hi Farid,
>
> yes, the layout for the root is a canvas, you can't use the flex key,
> but you can use the left, right, top and bottom keys.
>
> Look at the code snipped below, I hop it will solve your issue.
>
> Cheers,
> Chris
>
> *** code snipped ***
> var content = new qx.ui.container.Composite(new qx.ui.layout.Grid());
> for (var y=0; y<50; y++)
> {
> for (var x=0; x<50; x++)
> {
> content.add((new qx.ui.core.Widget()).set({
> backgroundColor : ((x+y) % 2 == 0) ? "black" : "blue",
> width : 60,
> allowShrinkY : false,
> allowShrinkX : false,
> height : 60
> }), {column: x, row: y});
> }
> }
>
> var scroller = new qx.ui.container.Scroll(content);
> this.getRoot().add(scroller, {top: 0, left: 0, right: 0, bottom: 0});
> *** end ***
>
> Farid Elyahyaoui schrieb:
>> Hi,
>>
>> thanks for your quick reply.
>>
>> I changed the line:
>> doc.add(scrollContainer, {left: 10, top: 10});
>> to
>> doc.add(scrollContainer, {left: 10, top: 10, flex:1});
>> and removed the lines to set the width and height of scrollContainer.
>> this generates assertion errors however which say that the canvas
>> layout does not
>> support 'flex' property. I don't use the canvas widget myself so I'm
>> guessing here that
>> the doc widget is a subclass of canvas (is this right?). Here is the
>> assert output:
>>
>>
>> 950ms Assertion error! The property 'flex' is not supported by the
>> canvas layout!: Called assert with 'false'Native.js (line 51)
>> 966ms Stack trace:
>> qx.core.AssertionError:constructor:48,qx.Class:constructor
>> wrapper:1526,qx.core.Assert:57,qx.core.Assert:75,qx.core.MAssert:assert:44,qx.ui.layout.Canvas:verifyLayoutProperty:119,qx.ui.core.LayoutItem:updateLayoutProperties:837,qx.ui.core.LayoutItem:setLayoutProperties:778,qx.ui.core.Widget:__addHelper:1966,qx.ui.core.Widget:_add:1736,webrobot.Application:main:76,qx.core.Init:68,qx.event.dispatch.Direct:constructor:99,qx.Interface:347,qx.event.Manager:642,qx.event.Registration:253,qx.event.handler.Application:__fireReady:161,qx.event.handler.Application:101,file:///home/felyahya/t/wr2/webrobot/source/script/webrobot.js:216,file:///home/felyahya/t/wr2/webrobot/source/script/webrobot.js:283Native.js
>> (line 51)
>> [Exception... "'The property 'flex' is not supported by the canvas
>> layout!: Called assert with 'false'' when calling method:
>> [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c
>> (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]
>>
>> On Thu, Dec 18, 2008 at 11:22 AM, Gaurav Jauhri <[email protected]> wrote:
>>
>>> Hi Farid,
>>>
>>> Farid Elyahyaoui wrote:
>>>
>>>> Hi people,
>>>>
>>>> My main application container consists of a Vbox.
>>>> After all widgets have been created the size grows and when your
>>>> browser window is not
>>>> big enought some parts fall outside the browser window and are
>>>> "unreachable".
>>>> For some reason the browser does not add scrollbars to scroll to the
>>>> 'hidden' parts.
>>>> What do I need to do to add scrollbars?
>>>> I tried using this in my application main():
>>>>
>>>> var doc = this.getRoot();
>>>> var scrollContainer= new qx.ui.container.Scroll();
>>>> scrollContainer.set({
>>>> width: 1000,
>>>> height: 650
>>>> });
>>>> doc.add(scrollContainer, {left: 10, top: 10});
>>>> this._mainvb= new qx.ui.container.Composite(new
>>>> qx.ui.layout.VBox(5));
>>>> scrollContainer.add(this._mainvb);
>>>>
>>>> but actually I don't want to set the width. If I don't do that the
>>>> scrollcontainer has some default
>>>> size of 200x200 pixels or so which is too small.
>>>> What other suggestions are there to add scrollbars around my VBox so
>>>> that the user can scroll to the
>>>> parts outside of the browser window?
>>>> Thanks in advance for all your help.
>>>>
>>>> Farid
>>>>
>>>>
>>>>
>>> When you add the scroll to ur doc , just set the flex property to 1 and
>>> it should work., for example
>>>
>>>
>>>
>>> doc.add(scrollContainer, {left: 10, top: 10, flex:1});
>>>
>>> Hope this works
>>>
>>> Cheers
>>> Gaurav!!
>>>
>>>
>>>
>>>> ------------------------------------------------------------------------------
>>>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>>>> The future of the web can't happen without you. Join us at MIX09 to help
>>>> pave the way to the Next Web now. Learn more and register at
>>>> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>>>> _______________________________________________
>>>> qooxdoo-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>
>>>>
>>>>
>>>>
>>> ------------------------------------------------------------------------------
>>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>>> The future of the web can't happen without you. Join us at MIX09 to help
>>> pave the way to the Next Web now. Learn more and register at
>>> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>> The future of the web can't happen without you. Join us at MIX09 to help
>> pave the way to the Next Web now. Learn more and register at
>> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>
>
> --
> Christian Schmidt
> Software Engineer
> Core Development :: Web Technologies
>
> 1&1 Internet AG
> Ernst-Frey-Str. 9
> 76135 Karlsruhe, Germany
> http://www.1und1.de
>
> Amtsgericht Montabaur / HRB 6484
>
> Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas
> Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver
> Mauss, Jan Oetjen
>
> Aufsichtsratsvorsitzender: Michael Scheeren
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel