Luc, the documentation is actually quite logical. getRoot returns a Widget 
which 
is a Container at the same time:

qx.application.AbstractGui:


getRoot()
Returns the application’s root widget. The root widgets can act as container 
for 
popups. It is configured with a qx.ui.layout.Basic (if the application is an 
inline application) layout or a qx.ui.layout.Canvas (if the application is a 
standalone application) layout .
The root has the same add method as the configured layout (qx.ui.layout.Basic 
or 
qx.ui.layout.Canvas).




----- Original Message ----
> From: Luc Saffre <[email protected]>
> To: qooxdoo Development <[email protected]>
> Sent: Tue, March 8, 2011 2:19:36 PM
> Subject: Re: [qooxdoo-devel] Undocumented Widget.add()?
> 
> On 8.03.2011 7:24, Tobias Oetiker wrote:
> >> Is this normal?
> > 
> > yes, the Widget object has only a protected add method (_add)  if
> > you enable the showing of protected methods in the api viewer  you
> > will see it ...
> > 
> > the idea is that the widget object  only provides a minimal set of
> > public methods and all other bits (the  ones required to populate
> > the widget) are protected and you would expose  them explicilty if
> > so needed (eg if the wiget is going to have the  capability to
> > contain arbitrary other widgets somewhere inside its  makeup).
> 
> But then there's a problem with the documentation of  the
> qx.application.Standalone.getRoot() method. (at least for beginners  like
> me). I had the following piece of code:
> 
>       var  toolBar = new qx.ui.toolbar.ToolBar();
>        this.getRoot().add(toolBar, {
>         left: 0,
>          top: 0,
>         right: 0
>        });
> 
> Then I looked  at
> http://demo.qooxdoo.org/1.3/apiviewer/#qx.application.Standalone
> which  says (after having clicked the "Inherited" button) that getRoot()
> returns a  Widget. And then I was confused to not find an add() method in
> Widget. OK, I  guess that the problem comes because the docstring of
> getRoot() is just  inherited from AbstractGui which indeed doesn't know
> what kind of Widget  Standalone.getRoot() will return. And thus I still
> don't know what kind of  Widget Standalone.getRoot() actually returns.
> 
> This is of course only a  minor problem in the documentation, which
> generally speaking is excellent.  Don't take my post as a complain, but
> rather as a hint on how to make it even  better.
> It is even a compliment: only good documentation deserves such  nit-picky
> suggestions  :-)
> 
> Luc
> 
> ------------------------------------------------------------------------------
> What  You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an  overview of data connectivity, details
> its effect on application quality, and  explores various alternative
> solutions.  http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> qooxdoo-devel  mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to