GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A switch widget. More...
Go to the source code of this file.
Functions | |
gp_widget * | gp_widget_switch_new (const char *on_label, gp_widget_stock_type on_stock, const char *off_label, gp_widget_stock_type off_stock, bool set) |
Allocate and initialize new switch widget. | |
static gp_widget * | gp_widget_switch_new_ev (const char *on_label, gp_widget_stock_type on_stock, const char *off_label, gp_widget_stock_type off_stock, bool set, int(*on_event)(gp_widget_event *ev), void *priv) |
Allocate and initialize new switch widget. | |
A switch widget.
Switch is a bool class widget, after it's created it's acessed by the class functions such as gp_widget_bool_set().
| Attribute | Type | Default | Description | |------------—|-----—|-------------------—|------------—00---------------—| | label | string | NULL | Sets both off_label and on_label. | | on_label | string | NULL | A label when switch is on. | | on_stock | string | GP_WIDGET_STOCK_NONE | Stock image when switch is on. | | off_label | string | NULL | A label when switch is off. | | off_stock | string | GP_WIDGET_STOCK_NONE | Stock image when switch is off. | | set | bool | false | Initial switch state. |
Definition in file gp_widget_switch.h.
gp_widget * gp_widget_switch_new | ( | const char * | on_label, |
gp_widget_stock_type | on_stock, | ||
const char * | off_label, | ||
gp_widget_stock_type | off_stock, | ||
bool | set | ||
) |
Allocate and initialize new switch widget.
on_label | A label when switch is on, can be NULL if there is none. |
on_stock | A stock image when switch is on, can be GP_WIDGET_STOCK_NONE if there is none. |
off_label | A label when switch is off, can be NULL if there is none. |
off_stock | A stock image when switch is off, can be GP_WIDGET_STOCK_NONE if there is none. |
set | An initial state for the switch. |
Referenced by gp_widget_switch_new_ev().
|
inlinestatic |
Allocate and initialize new switch widget.
on_label | A label when switch is on, can be NULL if there is none. |
on_stock | A stock image when switch is on, can be GP_WIDGET_STOCK_NONE if there is none. |
off_label | A label when switch is off, can be NULL if there is none. |
off_stock | A stock image when switch is off, can be GP_WIDGET_STOCK_NONE if there is none. |
set | An initial state for the switch. |
on_event | An widget event handler. |
priv | User private data. |
Definition at line 67 of file gp_widget_switch.h.
References gp_widget_on_event_set(), and gp_widget_switch_new().