AG_GRAPH(3)

NAME
AG_Scrollview - agar scrollable view widget

SYNOPSIS

    #include <agar/core.h>
    #include <agar/gui.h>

DESCRIPTION
The AG_Scrollview widget is a simple container which allows its child widgets to exceed its own size. It provides the user with AG_Scrollbar(3) controls to pan the view.

INHERITANCE HIERARCHY
AG_Object(3) -> AG_Widget(3) -> AG_Scrollview.

INITIALIZATION
AG_Scrollview * AG_ScrollviewNew(AG_Widget *parent, Uint flags)

void AG_ScrollviewSizeHint(AG_Scrollview *sv, Uint width, Uint height)

void AG_ScrollviewSetIncrement(AG_Scrollview *sv, int increment)

The AG_ScrollviewNew() function allocates, initializes, and attaches a new AG_Scrollview widget. Acceptable flags include:

AG_SCROLLVIEW_NOPAN_X
    Disable panning over X.

AG_SCROLLVIEW_NOPAN_Y
    Disable panning over Y.

AG_SCROLLVIEW_NOPAN_XY
    Alias for AG_SCROLLVIEW_NOPAN_X and AG_SCROLLVIEW_NOPAN_Y.

AG_SCROLLVIEW_BY_MOUSE
    Panning with cursor is permitted (may interfere with the operation of child widgets).

AG_SCROLLVIEW_FRAME
    Draw background and frame.

AG_SCROLLVIEW_HFILL
    Expand horizontally in parent (equivalent to invoking AG_ExpandHoriz(3)).

AG_SCROLLVIEW_VFILL
    Expand vertically in parent (equivalent to invoking AG_ExpandVert(3)).

AG_SCROLLVIEW_EXPAND
    Shorthand for AG_SCROLLVIEW_HFILL|AG_SCROLLVIEW_VFILL.

The AG_ScrollviewSizeHint() function requests an initial widget size for the AG_Scrollview in pixels.

AG_ScrollviewSetIncrement() sets the increment for scrolling the view, in pixels.

EVENTS
The AG_Scrollview widget does not generate any event.

STRUCTURE DATA
For the AG_Scrollview object:

int xOffs, yOffs
    Display offset in pixels (controlled by scrollbars).
int xMin, yMin
    Upper left display boundary (read-only).
int xMax, yMax
    Lower right display boundary (read-only).
AG_Scrollbar *hbar
    Pointer to horizontal scrollbar (or NULL).
AG_Scrollbar *vbar
    Pointer to vertical scrollbar (or NULL).

SEE ALSO
AG_Intro(3), AG_Scrollbar(3), AG_Widget(3), AG_Window(3)

HISTORY
The AG_Scrollview widget first appeared in Agar 1.3.3.