AG_Checkbox * AG_CheckboxNew (AG_Widget *parent, Uint flags, const char *format, ...)
AG_Checkbox * AG_CheckboxNewS (AG_Widget *parent, Uint flags, const char *label)
AG_Checkbox * AG_CheckboxNewFn (AG_Widget *parent, Uint flags, const char *label, AG_EventFn fn, const char *fmt, ...)
AG_Checkbox * AG_CheckboxNewInt (AG_Widget *parent, Uint flags, const char *label, int *pBool)
AG_Checkbox * AG_CheckboxNewUint (AG_Widget *parent, Uint flags, const char *label, Uint *pBool)
AG_Checkbox * AG_CheckboxNewFlag (AG_Widget *parent, Uint flags, const char *label, Uint *pFlags, Uint bitmask)
"AG_Checkbox *"() AG_CheckboxSetFromFlags (AG_Widget *parent, Uint flags, Uint *pFlags, const AG_FlagDescr *flagsDescr)
int AG_CheckboxGetState (AG_Checkbox *checkbox)
void AG_CheckboxSetState (AG_Checkbox *checkbox, int enable)
void AG_CheckboxToggle (AG_Checkbox *checkbox)
|
The
AG_CheckboxNew() function allocates, initializes, and attaches a
AG_Checkbox widget.
AG_CheckboxNew() accepts an optional text label argument.
The
AG_CheckboxNewFn() variant also assigns the specified callback function to the
checkbox-changed event.
Acceptable values for the
flags argument include:
AG_CHECKBOX_INVERT | Invert the logical interpretation of "state".
| AG_CHECKBOX_SET | Set default "state" to 1 (default = 0).
| AG_CHECKBOX_EXCL | Advise that this checkbox is the only widget accessing "state"
(so periodic updates are not needed).
| AG_CHECKBOX_HFILL | Expand horizontally in parent container.
| AG_CHECKBOX_VFILL | Expand vertically in parent container.
| AG_CHECKBOX_EXPAND | Shorthand for
AG_CHECKBOX_HFILL AG_CHECKBOX_VFILL|. |
The
AG_CheckboxNewInt() constructor binds "state" to a natural integer.
AG_CheckboxNewFlag() binds "state" to one or more bits in the natural integer at
pFlags, according to
bitmask a.
Note: While convenience constructors are only provided for natural integers,
AG_Checkbox can also bind to fixed-size integers (see
BINDINGS ) .
The utility function
AG_CheckboxSetFromFlags() creates a set of checkboxes for the given set of flags, described
by an array of
AG_FlagDescr structures:
typedef struct ag_flag_descr {
Uint bitmask; /* Bitmask */
const char *descr; /* Bit(s) description */
int writeable; /* User-editable */
} AG_FlagDescr;
|
AG_CheckboxGetState() returns the current state of the checkbox.
AG_CheckboxSetState() sets the of the checkbox, where 0=inactive and 0=active.
AG_CheckboxToggle() inverts the state atomically.
|