How to move a GnomeCanvasGroup?


I want to move a GnomeCanvasGroup to the coordenates (x,y), but using the
following code doesn't rerender its children on the canvas:

GnomeCanvasItem *citem; /* This is a GnomeCanvasGroup */
double x, y;
/* ... */
gnome_canvas_item_set (citem, "x", x, "y", y, NULL);

(I have had used gtk_object_set, but I remember that GnomeCanvasItem doesn't
watch for argument changes, which I was told is a bug that will be corrected
soon). I have to use the following code instead:

GnomeCanvasItem *citem; /* This is a GnomeCanvasGroup */
double x, y;
double old_x, old_y;
/* ... */
gtk_object_get (citem, "x", &old_x, "y", &old_y, NULL);
gnome_canvas_item_move (citem, -old_x, -old_y);
gnome_canvas_item_move (citem, x, y);

My questions are:

1. Is this a bug or a feature?
2. Is there any chance to get a gnome_canvas_item_move_absolute call, instead
the relative gnome_canvas_item_move?

Sorry if this questions has been asked before. Any pointer to documentation
about it will be happily recieved.


Arturo Tena

"we share our source code with others in the hopes that programmers overall can
make more progress by building on each other's works than by trying blindly to
replicate what was done decades ago"
   Philip Greenspun (

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