diff options
Diffstat (limited to 'src/gwin/checkbox.c')
-rw-r--r-- | src/gwin/checkbox.c | 6 |
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; } |