[Sugar-devel] Gtk.DrawingArea's draw signal

Benjamin Berg benzea at sugarlabs.org
Thu Jun 28 04:23:32 EDT 2012


On Wed, 2012-06-27 at 13:50 -0300, Manuel Kaufmann wrote:
> I'm not completely sure what I did :P , but I have Implode working
> under Gtk3 now :)
> 
> This is the diff:
> http://bugs.sugarlabs.org/attachment/ticket/3715/First-Working-Version.diff

It looks to me like the change could be that you are now connecting to
the "draw" signal, instead of overriding "do_draw(self, cr)". Though I
can't think of a reason for do_draw() not to work currently.

Other than that about the comment in _do_draw_event. The area will be
clipped by GTK+ already.
This means that you can just start drawing. Should you need to know
about the redrawn area to do further optimizations you can use
cr.clip_extends() or Gdk.cairo_get_clip_rectangle().

ie.:
  clipped, rect = Gdk.cairo_get_clip_rectangle(cr)

clipped will always be True in GTK+. rect then contains the affected
area, similar to event.area before.

Benjamin



More information about the Sugar-devel mailing list