class Fl_Scroll : public Fl_Group

This container widget lets you maneuver around a set of widgets much larger than your window. If the child widgets are larger than the size of this object then scrollbars will appear so that you can scroll over to them:

If all the child widgets are packed together into a solid rectangle then you want to set box() to FL_NO_BOX or one of the _FRAME types. This will result in the best output. However, if the child widgets are a sparse arrangment you must set box() to a real _BOX type. This can result in some blinking during redrawing, but that can be solved by using an Fl_Double_Window.

This widget can also be used to pan around a single child widget "canvas". This child widget should be of your own class, with a draw() method that draws the contents. The scrolling is done by changing the x() and y() of the widget, so this child must use the x() and y() to position it's drawing. To speed up drawing it should test fl_clip().

Another very useful child is a single Fl_Pack, which is itself a group that packs it's children together and changes size to surround them. Filling the Fl_Pack with Fl_Tab groups (and then putting normal widgets inside those) gives you a very powerful scrolling list of individually-openable panels.

Fluid lets you create these, but you can only lay out objects that fit inside the Fl_Scroll without scrolling. Be sure to leave space for the scrollbars, as Fluid won't show these either.

You cannot use Fl_Window as a child of this, the clipping is not conveyed to them when they draw, and they will draw over the scrollbars and neighboring objects.

Fl_Scroll::Fl_Scroll(int x,int y,int w,int h, const char * = 0);

The constructor. Use add(Fl_Widget *) to add each child. Use end() to finish adding children.

void Fl_Widget::type(int);

By default you can scroll in both directions, and the scrollbars disappear if the data will fit in the area of the scroll. type() can change this:

void Fl_Scroll::scrollbar.align(int);

This is used to change what side the scrollbars are drawn on. If the FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left. If the FL_ALIGN_TOP bit is on, the horizontal scrollbar is on the top.

Fl_Scrollbar& Fl_Scroll::scrollbar;
Fl_Scrollbar& Fl_Scroll::hscrollbar;

The child scrollbars are public instance variables. You can modify their widths, types, color, box(), etc, to customize your display (unfortunately fluid has no support for this, but type the code into the extra code fields). You may also want to test visible() on them to see if they are displayed.

int Fl_Scroll::xposition() const;
int Fl_Scroll::yposition() const;
void Fl_Scroll::position(int w, int h);

This is where the upper-left corner of the contents are, compared to the upper-left corner of the Fl_Scroll. Setting this will scroll it to that position and redraw.