diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-06-24 22:58:37 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-06-24 22:58:37 +1000 |
commit | 8ed9e763c0f97f2946990a911bb940f8c80ff761 (patch) | |
tree | 5f6c19677a530ddfada345242bce1190e3797dfa /src/gwin/gwidget.c | |
parent | c8300fe9c2c7facff1ad32978a5d961690473de4 (diff) | |
download | uGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.tar.gz uGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.tar.bz2 uGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.zip |
GWIN reduce Initialisation parameters and fix visibility issues
Diffstat (limited to 'src/gwin/gwidget.c')
-rw-r--r-- | src/gwin/gwidget.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gwin/gwidget.c b/src/gwin/gwidget.c index 9d634c58..2825bf4c 100644 --- a/src/gwin/gwidget.c +++ b/src/gwin/gwidget.c @@ -165,15 +165,15 @@ void _gwidgetInit(void) { geventRegisterCallback(&gl, gwidgetEvent, 0); } -GHandle _gwidgetCreate(GWidgetObject *pgw, coord_t x, coord_t y, coord_t width, coord_t height, size_t size, const gwidgetVMT *vmt) { - if (!(pgw = (GWidgetObject *)_gwindowCreate((GWindowObject *)pgw, x, y, width, height, size, (const gwinVMT *)vmt, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED))) +GHandle _gwidgetCreate(GWidgetObject *pgw, GWidgetInit *pInit, const gwidgetVMT *vmt) { + if (!(pgw = (GWidgetObject *)_gwindowCreate(&pgw->g, &pInit->g, &vmt->g, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED))) return 0; - pgw->txt = ""; + pgw->txt = pInit->text ? pInit->text : ""; pgw->fnDraw = vmt->DefaultDraw; pgw->fnParam = 0; - return (GHandle)pgw; + return &pgw->g; } void _gwidgetDestroy(GHandle gh) { |