aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/graph.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/graph.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/graph.c')
-rw-r--r--src/gwin/graph.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gwin/graph.c b/src/gwin/graph.c
index 708b90cb..81ce1b5f 100644
--- a/src/gwin/graph.c
+++ b/src/gwin/graph.c
@@ -31,6 +31,7 @@ static const GGraphStyle GGraphDefaultStyle = {
static const gwinVMT graphVMT = {
"Graph", // The classname
+ sizeof(GGraphObject), // The object size
0, // The destroy routine
0, // The redraw routine
0, // The after-clear routine
@@ -164,12 +165,13 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t
}
}
-GHandle gwinCreateGraph(GGraphObject *gg, coord_t x, coord_t y, coord_t width, coord_t height) {
- if (!(gg = (GGraphObject *)_gwindowCreate((GWindowObject *)gg, x, y, width, height, sizeof(GGraphObject), &graphVMT, GWIN_FLG_VISIBLE)))
+GHandle gwinCreateGraph(GGraphObject *gg, GWindowInit *pInit) {
+ if (!(gg = (GGraphObject *)_gwindowCreate(&gg->g, pInit, &graphVMT, 0)))
return 0;
gg->xorigin = gg->yorigin = 0;
gg->lastx = gg->lasty = 0;
gwinGraphSetStyle((GHandle)gg, &GGraphDefaultStyle);
+ gwinSetVisible((GHandle)gg, pInit->show);
return (GHandle)gg;
}