class Fl_Scroll : public Fl_Group

This widget has not been used in any real software and is thus experimental. There are likely to be bugs or defects in implementation that may need to be fixed. Please tell me what you discover if you use this.

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:

Fl_Scroll works best if it's box() is FL_NO_BOX. You should then completely fill a rectangular area with child widgets so that no area is left undrawn. Use Fl_Box to make flat empty areas.

If desired because of a sparse arrangment of children or for outside labels, you can set the box() to FL_FLAT_BOX. This may produce some blinking in the scrolling area. This can be solved by using an Fl_Double_Window.

You can use this to pan around a "canvas" with arbitrary graphics by making a single large child widget. 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 children widgets, so this child must use the x() and y() to position it's drawing.

Child Fl_Windows do not work, unfortunately, as 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 type(int);

It is possible to make the scrolling work only horizontally or vertically. Resizing the window in the other direction will stretch the children in that direction:

int Fl_Scroll::width() const;
int Fl_Scroll::height() const;
void Fl_Scroll::area(int w, int h);
void Fl_Scroll::init_area();

The total size of all the objects being scrolled. It is automatically calculated by the bounding box of all the children. If you add or delete any children after the window containing the Fl_Scroll has been displayed you should call init_area() to recalculate the area. Set it directly with area() if desired.

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.

Fl_Slider& Fl_Scroll::xslider();
Fl_Slider& Fl_Scroll::yslider();

Returns references to the child slider widgets, so you can modify their colors, width, or appearance.