modifying points of a polyline



hi,

I have a polyline initialy created as
      item->citem = goo_canvas_polyline_new (self->priv->canvas_root, FALSE, 2,
        item->ns->x, item->ns->y,
        item->ne->x, item->ne->y,
        "stroke-color", "red",
        "line-width", 1.0,
        NULL);

later on the coorinates change. Is this the way to update them?

      GooCanvasPoints *points;
      // modify the points
      g_object_get (item->citem, "points", &points, NULL);
      points->coords[0]=item->ns->x;
      points->coords[1]=item->ns->y;
      points->coords[2]=item->ne->x;
      points->coords[3]=item->ne->y;
      g_object_set (item->citem, "points", points, NULL);
      goo_canvas_points_unref (points);


Stefan


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