Changes between Initial Version and Version 1 of Ticket #6407, comment 3


Ignore:
Timestamp:
Aug 19, 2010, 2:43:43 PM (14 years ago)
Author:
pulkomandy

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6407, comment 3

    initial v1  
    33
    44Basically, there are two places where it will be useful:
    5 *It will allow for nested layouts, so that instead of this kind of thing:
    6 
     5 * It will allow for nested layouts, so that instead of this kind of thing:
     6{{{
    77BGroupView* myGroupView = new BGroupView(B_HORIZONTAL);
    88BGroupView* nestedGroup;
     
    1414nestedGroup->AddChild(new BButton("b"));
    1515nestedGroup->AddChild(new BButton("b"));
     16}}}
    1617
    1718You could forego the creation of the nestedGroup BView, and simply add BGroupLayouts to myGroupView. This way, we avoid the overhead of having another two views in there, when their only purpose is to host a BGroupLayout. This also means that all those BButtons will be children of myGroupView. (That's not really an advantage, but I thought I'd mention it)
    1819An even more 'extreme' scenario might be to avoid adding any organizational views at all to your window (of course, BWindow::fTopView will still be there).
    1920
    20 *Another use case is laying out objects that are not strictly related to BViews. (Composing a document for example, you could use many nested layouts for the different elements).
     21 * Another use case is laying out objects that are not strictly related to BViews. (Composing a document for example, you could use many nested layouts for the different elements).