GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_checkbox.h
Go to the documentation of this file.
1//SPDX-License-Identifier: LGPL-2.0-or-later
2
3/*
4
5 Copyright (c) 2014-2023 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
16#ifndef GP_WIDGET_CHECKBOX_H
17#define GP_WIDGET_CHECKBOX_H
18
20
29gp_widget *gp_widget_checkbox_new(const char *label, int val);
30
41static inline gp_widget *gp_widget_checkbox_new2(const char *label, int val,
42 int (*on_event)(gp_widget_event *ev),
43 void *priv)
44{
45 gp_widget *ret = gp_widget_checkbox_new(label, val);
46
47 gp_widget_on_event_set(ret, on_event, priv);
48
49 return ret;
50}
51
58void gp_widget_checkbox_set(gp_widget *self, int val);
59
65void gp_widget_checkbox_toggle(gp_widget *self);
66
67
76int gp_widget_checkbox_get(gp_widget *self);
77
78#endif /* GP_WIDGET_CHECKBOX_H */
A bollean widget class.
void gp_widget_checkbox_set(gp_widget *self, int val)
Sets a checkbox value.
int gp_widget_checkbox_get(gp_widget *self)
Returns a checkbox value.
void gp_widget_checkbox_toggle(gp_widget *self)
Toggles a checkbox value.
static gp_widget * gp_widget_checkbox_new2(const char *label, int val, int(*on_event)(gp_widget_event *ev), void *priv)
Allocate and initialize new checkbox widget.
gp_widget * gp_widget_checkbox_new(const char *label, int val)
Allocate and initialize new checkbox widget.
Event structure passed to widget event handler.