Re: [gnome-print] How to create GnomeCanvasBpath?



i wrote the following code, gcc did not report any error, but when running,
the curve item did not appear in the canvas immediatly, it was drawn after
refresh. and when pointer closed to the curve, progrom crashed -(
what's wrong?
thanks!

GnomeCanvasGroup * group = group;
GnomeCanvasItem;
GPPath * bpath;

bpath = gp_path_new();

bpath->path[0].code = ART_MOVE_OPEN;
bpath->path[0].x1 = x01;
bpath->path[0].y1 = y01;
bpath->path[0].x2 = x02;
bpath->path[0].y2 = y02;
bpath->path[0].x3 = x03;
bpath->path[0].y3 = y03;

bpath->path[1].code = ART_CURVETO;
bpath->path[1].x1 = x11;
bpath->path[1].y1 = y11;
bpath->path[1].x2 = x12;
bpath->path[1].y2 = y12;
bpath->path[1].x3 = x13;
bpath->path[1].y3 = y13;

bpath->path[2].code = ART_END;
bpath->path[2].x1 = x21;
bpath->path[2].y1 = y21;
bpath->path[2].x2 = x22;
bpath->path[2].y2 = y22;
bpath->path[2].x3 = x23;
bpath->path[2].y3 = y23;

item = gnome_canvas_item_new(group,
                             gnome_canvas_bpath_get_type(),
                             "bpath", bpath,
                             "fill_color", "#ff0000",
                             NULL);







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]