It is the canvas item's responsibility to request an
update or redraw when the properties of the item are
changed and the screen should be refreshed. This is
straightforward. For example, here is a snippet of code
from
gnome_canvas_re_set_arg(), which sets the "y2" argument:
case ARG_Y2:
re->y2 = GTK_VALUE_DOUBLE (*arg);
gnome_canvas_item_request_update (item);
break;
|
Since "y2" modifies the
shape of the rectangle, the path must be recreated and
an update is necessary. Note that
gnome_canvas_item_request_update() simply sets a
flag and installs an idle handler if none is pending,
so it can be called many times without a performance
penalty.
Not all changes require an update; a redraw may be
sufficient, or perhaps the argument is unrelated to the
display. It depends on the canvas item and what exactly
is being changed.