Hi, I have a layout like this:
BRect frame(100, 100, 300, 400); sizeTestWin = new win(frame); BStringView* label = new BStringView("label1", "This is a test"); BView* viu = new BView("vu", B_WILL_DRAW | B_FRAME_EVENTS); BScrollBar* scroll = new BScrollBar("scroll", viu, 0, 0, B_VERTICAL); BBox* top = new BBox("box"); BGroupLayout* top_box = BLayoutBuilder::Group<>(top, B_VERTICAL) .Add(label) .SetInsets(B_USE_SMALL_INSETS, B_USE_SMALL_INSETS, B_USE_SMALL_INSETS, B_USE_SMALL_INSETS); BGroupLayout* group = BLayoutBuilder::Group<>(sizeTestWin, B_VERTICAL, 0) .Add(top_box) .AddGroup(B_HORIZONTAL, 0) .Add(viu) .Add(scroll) .End(); BStringView* label2 = new BStringView("label2", "This is text"); BStringView* label3 = new BStringView("label3", "This is more text"); BStringView* label4 = new BStringView("label4", "This is the most text"); BGroupLayout* view_group = BLayoutBuilder::Group<>(viu, B_VERTICAL, 20) .Add(label2) .Add(label3) .Add(label4) .AddGlue();
It works fine as long as the window is larger than the inner view contents:
but then when I make the window shorter, the scrollbar seems “locked” to the height of the “viu” BView. I understand that I have it targeting the view, but when the parent window is resized to shorter than the inner view, it cuts off the scroll bar instead of adjusting the scroll bar to the contents.
i thought the scroll bar ought to resize/reproportion based on the parent size, as a scroll bar does. How can I make it control/scroll the inner “viu” but never get cut off by the parent window? Even if I try to adjust the scroll bar range and proportion it still gets cut off by the window.