Note: The Agar manual pages follow certain conventions, notably
concerning function return values. Please read
AG_Intro(3)
first.
SYNOPSIS
#include <agar/core.h>
#include <agar/gui.h>
|
DESCRIPTION
|
The
AG_ProgressBar widget binds to minimum, maximum and value integers and displays a progress
bar representing the value.
|
INHERITANCE HIERARCHY
INITIALIZATION
AG_ProgressBar * AG_ProgressBarNew (AG_Widget *parent, enum ag_progress_bar_type type, Uint flags)
AG_ProgressBar * AG_ProgressBarNewInt (AG_Widget *parent, enum ag_progress_bar_type type, Uint flags, int *value, int *min, int *max)
AG_ProgressBar * AG_ProgressBarNewHoriz (AG_Widget *parent, Uint flags)
AG_ProgressBar * AG_ProgressBarNewVert (AG_Widget *parent, Uint flags)
void AG_ProgressBarSetWidth (AG_ProgressBar *pb, int width)
void AG_ProgressBarSetLength (AG_ProgressBar *pb, int length)
int AG_ProgressBarPercent (AG_ProgressBar *pb)
|
The
AG_ProgressBarNew() function allocates, initializes, and attaches a new
AG_ProgressBar widget.
type defines the style:
enum ag_progress_bar_type {
AG_PROGRESS_BAR_HORIZ,
AG_PROGRESS_BAR_VERT
};
Acceptable
flags include:
| AG_PROGRESS_BAR_SHOW_PCT | Display text showing the percentage.
| | AG_PROGRESS_BAR_HFILL | Expand horizontally in parent (equivalent to invoking
AG_ExpandHoriz(3)). If this flag is not used,
AG_ProgressBarSetLength() should be called explicitely.
| | AG_PROGRESS_BAR_VFILL | Expand vertically in parent (equivalent to invoking
AG_ExpandVert(3)). If this flag is not used,
AG_ProgressBarSetLength() should be called explicitely.
| | AG_PROGRESS_BAR_EXPAND | Shorthand for
AG_PROGRESS_BAR_HFILL|AG_PROGRESS_BAR_VFILL. |
The
AG_ProgressBarNewInt() variant binds the
value, min and
max bindings on initialization.
The
AG_ProgressBarNewHoriz() and
AG_ProgressBarNewVert() variants specify the layout on initialization.
The
AG_ProgressBarSetWidth() function sets the width of the bar in pixels.
AG_ProgressBarSetLength() requests a preferred length in pixels.
Alternatively,
AG_PROGRESS_BAR_HFILL or
AG_PROGRESS_BAR_VFILL may be used.
The
AG_ProgressBarPercent() returns the percentage for the currently bound value and range.
|
BINDINGS
The
AG_ProgressBar widget provides the following bindings:
| int *value | Current value
| | int *min | Minimum value
| | int *max | Maximum value
|
|
EVENTS
|
The
AG_ProgressBar widget neither reacts to nor generates any event.
|
SEE ALSO
HISTORY
|
The
AG_ProgressBar widget first appeared in
Agar 1.3.
|