AG_Label * AG_LabelNew (AG_Widget *parent, Uint flags, const char *fmt, ...)
AG_Label * AG_LabelNewS (AG_Widget *parent, Uint flags, const char *text)
AG_Label * AG_LabelNewPolled (AG_Widget *parent, Uint flags, const char *fmt, ...)
AG_Label * AG_LabelNewPolledMT (AG_Widget *parent, Uint flags, AG_Mutex *mutex, const char *fmt, ...)
void AG_LabelText (AG_Label *label, const char *format, ...)
void AG_LabelTextS (AG_Label *label, const char *s)
void AG_LabelSetFont (AG_Label *label, AG_Font *font)
void AG_LabelSetColor (AG_Label *label, AG_Color C)
void AG_LabelSetColorBG (AG_Label *label, AG_Color C)
void AG_LabelSetPadding (AG_Label *label, int left, int right, int top, int bottom)
void AG_LabelJustify (AG_Label *label, enum ag_text_justify justify)
void AG_LabelValign (AG_Label *label, enum ag_text_valign valign)
void AG_LabelSizeHint (AG_Label *label, Uint nlines, const char *text)
|
The
AG_LabelNew() function allocates, initializes and attaches a
AG_Label widget initially displaying the given text.
The
AG_LabelNewPolled() function creates a new
AG_Label widget displaying a string of text which contains references to variables.
The
AG_LabelNewPolledMT() variant accepts a pointer to a mutex that will be automatically acquired
and release as the widget accesses the referenced data.
See the
POLLED LABELS section for more details.
See
LABEL FLAGS section for a the accepted
flags values for
AG_LabelNew() and
AG_LabelNewPolled().
The
AG_LabelText() function changes the current label text.
The
AG_LabelSetFont() function configures an alternate font which will be used to display the
label.
The
font argument is not duplicated (i.e., the referenced font should remain valid
as long as the widget exists).
To set the font of a label back to the default Agar font, NULL can be passed.
See
AG_FetchFont(3) for details on Agar fonts.
AG_LabelSetColor() and
AG_LabelSetColorBG() configure an alternate text and background color for the label (see
AG_Color(3)).
AG_LabelSetPadding() sets the label padding parameters in pixels.
If a parameter is -1, its current value is preserved.
The
AG_LabelJustify() function sets the text justification:
enum ag_text_justify {
AG_TEXT_LEFT,
AG_TEXT_CENTER,
AG_TEXT_RIGHT
};
|
AG_LabelValign() sets the vertical text alignment:
enum ag_text_valign {
AG_TEXT_TOP,
AG_TEXT_MIDDLE,
AG_TEXT_BOTTOM
};
|
The
AG_LabelSizeHint() function arranges for the minimum scaling of the label to accomodate at
least
nlines lines of the given text string.
If
nlines is 0, the number of lines will be based on the contents of the text string.
|