From a68d64edca4f67df49b9499272319cad93d38bbe Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 27 Dec 2014 21:57:29 +0000 Subject: Draw from callbacks --- src/sc_interp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/sc_interp.c') diff --git a/src/sc_interp.c b/src/sc_interp.c index f628754..7d90b4f 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -184,8 +184,12 @@ static void do_callback(SCInterpreter *scin, SCBlock *bl, const char *name) } for ( i=0; in_callbacks; i++ ) { + cairo_surface_t *surf; if ( strcmp(cbl->names[i], name) != 0 ) continue; - cbl->funcs[i](scin, bl, cbl->vps[i]); + surf = cbl->funcs[i](scin, bl, cbl->vps[i]); + if ( surf == NULL ) return; + add_surface_box(sc_interp_get_frame(scin)->boxes, surf, + 256, 256); // FIXME: Box size return; } -- cgit v1.2.3