GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Functions
gp_widget_checkbox.h File Reference

A checkbox widget. More...

#include <widgets/gp_widget_class_bool.h>

Go to the source code of this file.

Functions

gp_widgetgp_widget_checkbox_new (const char *label, bool set)
 Allocate and initialize new checkbox widget.
 
static gp_widgetgp_widget_checkbox_new2 (const char *label, bool set, int(*on_event)(gp_widget_event *ev), void *priv)
 Allocate and initialize new checkbox widget.
 
const char * gp_widget_checkbox_label_get (gp_widget *self)
 Gets checkbox label.
 

Detailed Description

A checkbox widget.

Checkbox is a bool class widget, after it's created it's acessed by the class functions such as gp_widget_bool_set().

Checkbox widget JSON attributes

Attribute Type Default Description
label string A checkbox label, can be NULL if there is none.
set bool False Initial checkbox value.

Definition in file gp_widget_checkbox.h.

Function Documentation

◆ gp_widget_checkbox_label_get()

const char * gp_widget_checkbox_label_get ( gp_widget self)

Gets checkbox label.

Parameters
selfA checkbox widget.
Returns
A checkbox label or NULL if there is none.

◆ gp_widget_checkbox_new()

gp_widget * gp_widget_checkbox_new ( const char *  label,
bool  set 
)

Allocate and initialize new checkbox widget.

Parameters
labelA checkbox label.
valInitial checkbox value.
Returns
A checkbox widget.

Referenced by gp_widget_checkbox_new2().

◆ gp_widget_checkbox_new2()

static gp_widget * gp_widget_checkbox_new2 ( const char *  label,
bool  set,
int(*)(gp_widget_event *ev)  on_event,
void *  priv 
)
inlinestatic

Allocate and initialize new checkbox widget.

Parameters
labelA checkbox label.
valInitial checkbox value.
on_eventAn widget event handler.
privUser private data.
Returns
A checkbox widget.

Definition at line 52 of file gp_widget_checkbox.h.

References gp_widget_checkbox_new(), and gp_widget_on_event_set().