From 8ed9e763c0f97f2946990a911bb940f8c80ff761 Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 24 Jun 2013 22:58:37 +1000 Subject: GWIN reduce Initialisation parameters and fix visibility issues --- src/gwin/gwidget.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gwin/gwidget.c') 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) { -- cgit v1.2.3