GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A button widget. More...
#include <widgets/gp_widget_class_bool.h>
Go to the source code of this file.
Functions | |
gp_widget * | gp_widget_button_new (const char *label, enum gp_widget_button_type type) |
Allocates and initializes a new button widget. | |
static gp_widget * | gp_widget_button_new2 (const char *label, enum gp_widget_button_type type, int(*on_event)(gp_widget_event *ev), void *priv) |
Allocates a initialize new button widget. | |
enum gp_widget_button_type | gp_widget_button_type_get (gp_widget *self) |
Returns a button type. | |
void | gp_widget_button_type_set (gp_widget *self, enum gp_widget_button_type type) |
Sets a button type. | |
const char * | gp_widget_button_label_get (gp_widget *self) |
Gets a button label. | |
A button widget.
Buttons with a specific type include a stock image in the rendered button, they can have label as well but it's not required.
Attribute | Type | Default | Description |
---|---|---|---|
label | string | A button label. | |
btype | string | "label" | Button type, gp_widget_button_type. |
text_align | string | depends | Button text alignment, "left" or "right" from the stock image. |
The 'text_align' can be either 'left' or 'right' and the default value depends on the 'btype'.
Definition in file gp_widget_button.h.
A gp_widget_event::sub_type for a button widget.
Enumerator | |
---|---|
GP_WIDGET_BUTTON_TRIGGER | Emitted when button is pressed. |
Definition at line 144 of file gp_widget_button.h.
A button type.
Definition at line 44 of file gp_widget_button.h.
const char * gp_widget_button_label_get | ( | gp_widget * | self | ) |
Gets a button label.
self | A button widget. |
gp_widget * gp_widget_button_new | ( | const char * | label, |
enum gp_widget_button_type | type | ||
) |
Allocates and initializes a new button widget.
label | A button label. |
type | A button type. |
Referenced by gp_widget_button_new2().
|
inlinestatic |
Allocates a initialize new button widget.
label | A button label. Optional for buttons with type other than GP_BUTTON_LABEL. |
type | A button type. |
on_event | An widget event handler. |
priv | User private data. |
Definition at line 172 of file gp_widget_button.h.
References gp_widget_button_new(), and gp_widget_on_event_set().
enum gp_widget_button_type gp_widget_button_type_get | ( | gp_widget * | self | ) |
Returns a button type.
The aligment is masked out of the return value.
self | A button widget. |
void gp_widget_button_type_set | ( | gp_widget * | self, |
enum gp_widget_button_type | type | ||
) |
Sets a button type.
self | A button widget. |
type | New button type. |