aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/checkbox.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-06-24 22:58:37 +1000
committerinmarket <andrewh@inmarket.com.au>2013-06-24 22:58:37 +1000
commit8ed9e763c0f97f2946990a911bb940f8c80ff761 (patch)
tree5f6c19677a530ddfada345242bce1190e3797dfa /src/gwin/checkbox.c
parentc8300fe9c2c7facff1ad32978a5d961690473de4 (diff)
downloaduGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.tar.gz
uGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.tar.bz2
uGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.zip
GWIN reduce Initialisation parameters and fix visibility issues
Diffstat (limited to 'src/gwin/checkbox.c')
-rw-r--r--src/gwin/checkbox.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gwin/checkbox.c b/src/gwin/checkbox.c
index 0282df42..b4628ae0 100644
--- a/src/gwin/checkbox.c
+++ b/src/gwin/checkbox.c
@@ -34,6 +34,7 @@ static uint16_t ToggleGet(GWidgetObject *gw, uint16_t role);
static const gwidgetVMT checkboxVMT = {
{
"Checkbox", // The classname
+ sizeof(GCheckboxObject),// The object size
_gwidgetDestroy, // The destroy routine
_gwidgetRedraw, // The redraw routine
0, // The after-clear routine
@@ -112,12 +113,13 @@ static uint16_t ToggleGet(GWidgetObject *gw, uint16_t role) {
return ((GCheckboxObject *)gw)->toggle;
}
-GHandle gwinCreateCheckbox(GCheckboxObject *gb, coord_t x, coord_t y, coord_t width, coord_t height) {
- if (!(gb = (GCheckboxObject *)_gwidgetCreate((GWidgetObject *)gb, x, y, width, height, sizeof(GCheckboxObject), &checkboxVMT)))
+GHandle gwinCreateCheckbox(GCheckboxObject *gb, GWidgetInit *pInit) {
+ if (!(gb = (GCheckboxObject *)_gwidgetCreate(&gb->w, pInit, &checkboxVMT)))
return 0;
gb->toggle = (uint16_t) -1;
gb->c = defaultColors; // assign the default colors
+ gwinSetVisible((GHandle)gb, pInit->g.show);
return (GHandle)gb;
}