[haiku-development] BScrollView and layouts

  • From: Brian Hill <brianh@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 17 Jan 2017 06:51:45 -0500

Does the BScrollView class work with a target view that uses a layout? I have a BGroupView as the scrollview target, but adding views to the group view just seems to add it to the window layout instead. See the screenshot below. I have add two views to the notification center window (and no scrollbar appears) and then closed one of the notifications which then reveals the scrollbar in the space formerly located by the closed notification.

https://drive.google.com/file/d/0B8n9qMefrOQJei1vTThGMUl4M28/view?usp=sharing

Here is where I setup the views in the windwo constructor:

SetLayout(new BGroupLayout(B_VERTICAL, 0));
BStringView* label = new BStringView("label", "Notification Center");
fContainerView = new BGroupView(B_VERTICAL);
fScrollView = new BScrollView("Notifications",
       fContainerView, 0, false, true, B_NO_BORDER);
GetLayout()->AddView(label);
GetLayout()->AddView(fScrollView);

And here is how I have tried to add an instance of a GroupView (variable "group"), also trying with the commented out code to set the scrollview target directly to the new GroupView "group":

//    fScrollView->SetTarget(group);
   fContainerView->GroupLayout()->AddView(group);

-Brian

Other related posts: