Agar
Agar 1.7 Manual

AG_Fixed(3)

SYNOPSIS

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

DESCRIPTION

ScreenshotThe AG_Fixed container widget positions and sizes its children at constant positions specified in pixels.

INHERITANCE HIERARCHY

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

INITIALIZATION


AG_Fixed * AG_FixedNew (AG_Widget *parent, Uint flags)

void AG_FixedSetStyle (AG_Fixed *fixed, enum ag_fixed_style style)

void AG_FixedSizeHint (AG_Fixed *fixed, int w, int h)


The AG_FixedNew() function allocates, initializes, and attaches a new AG_Fixed widget. Accepted flags options include:
AG_FIXED_NO_UPDATEDon't automatically call AG_WidgetUpdate(3) whenever widgets are repositioned. This allows the caller to, as an optimization use AG_WidgetUpdate(3) only once after all widgets have been positioned.
AG_FIXED_HFILLExpand horizontally in parent container.
AG_FIXED_VFILLExpand vertically in parent container.
AG_FIXED_EXPANDShorthand for AG_FIXED_HFILL AG_FIXED_VFILL|.

AG_FixedSetStyle() selects an alternate background and border style:
AG_FIXED_STYLE_NONE No background.
AG_FIXED_STYLE_BOX Raised box & border.
AG_FIXED_STYLE_WELL 3D well & border (the default).
AG_FIXED_STYLE_PLAIN Filled rectangle.

Visible background styles use the style attributes "background-color", "low-color" and "high-color".

AG_FixedSizeHint() requests an initial size of w by h pixels.

CHILD WIDGETS


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

void AG_FixedDel (AG_Fixed *fixed, AG_Widget *child)

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

void AG_FixedMove (AG_Fixed *fixed, AG_Widget *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.

STRUCTURE DATA

For the AG_Fixed object:
enum ag_fixed_style style Background style (see AG_FixedSetStyle()).

EXAMPLES

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

SEE ALSO

AG_Box(3), AG_Intro(3), AG_MPane(3), AG_Pane(3), AG_Widget(3), AG_Window(3)

HISTORY

The AG_Fixed widget first appeared in Agar 1.0. In Agar 1.6.0 the former AG_FIXED_BOX, AG_FIXED_INVBOX, AG_FIXED_FRAME and AG_FIXED_FILLBG flags were replaced by the AG_FixedSetStyle() and the style parameter. AG_FixedSizeHint() appeared in Agar 1.6.0.


ElectronTubeStore Csoft.net www.libAgar.org is © 2024 Julien Nadeau Carriere <vedge@csoft.net>.
Support LibAgar: www.patreon.com/libAgar.