AG_FIXED(3)

NAME
AG_Fixed - agar pixel-precision container

SYNOPSIS

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

DESCRIPTION
The AG_Fixed container widgets positions its children at specific locations given in pixels. It is useful for positioning cosmetic components applications such as games, running at fixed resolutions.

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

INITIALIZATION
AG_Fixed * AG_FixedNew(AG_Widget *parent, Uint flags)

The AG_FixedNew() function allocates, initializes, and attaches a new AG_Fixed widget. The flags may include:

AG_FIXED_FILLBG
    Fill the widget background with FIXED_BG_COLOR.

AG_FIXED_BOX
    Draw a decorative 3D-style box in the background.

AG_FIXED_FRAME
    Draw a decorative frame in the background.

AG_FIXED_NO_UPDATE
    Disable automatic invocation of AG_WidgetUpdate(3) whenever widgets are repositioned. As an optimisation when large number of widgets are to be positioned, this option can be used and AG_WidgetUpdate(3) manually invoked only once all widgets are in place.

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

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

AG_FIXED_EXPAND
    Shorthand for AG_FIXED_HFILL|AG_FIXED_VFILL.

CHILD WIDGETS
void AG_FixedPut(AG_Fixed *fixed, void *child, int x, int y)

void AG_FixedDel(AG_Fixed *fixed, void *child)

void AG_FixedSize(AG_Fixed *fixed, void *child, int width, int height)

void AG_FixedMove(AG_Fixed *fixed, void *child, int new_x, int new_y)

The AG_FixedPut() function attaches the widget child and positions it at the given coordinates. AG_FixedDel() detaches the given widget.

Alternatively, you can avoid AG_FixedPut() and AG_FixedDel() altogether and instead use AG_ObjectAttach(3) and AG_ObjectDetach(3) followed by calls to AG_FixedSize() and AG_FixedMove().

Functions AG_FixedSize() and AG_FixedMove() set the size and location of a given widget in pixels.

EVENTS
The AG_Fixed widget does not generate any event.

EXAMPLES
See tests/fixedres.c in the Agar source distribution.

SEE ALSO
AG_Box(3), AG_HBox(3), AG_Intro(3), AG_MPane(3), AG_Pane(3), AG_VBox(3), AG_Widget(3), AG_Window(3)

HISTORY
The AG_Fixed widget first appeared in Agar 1.0.