[cairo] problem refreshing cairo surface
Zoltán Vörös
zvoros at gmail.com
Sun Nov 13 03:18:58 PST 2011
On 11/13/2011 06:47 AM, Kalle Vahlman wrote:
> I don't immediately spot the error, though there is a possible race
> condition between configure_event (which is an asynchronous event by
> nature) and trying to use the context it creates in on_load(). That
> should probably give an error though.
I think your suspicion was correct. This works, although I am not sure
whether this is how it should be done:
self.DA = Preview()
self.widget('box_preview').pack_start(self.DA.da, True, True, 0)
while Gtk.events_pending():
Gtk.main_iteration()
self.draw_note(self.DA.da, self.DA.surface)
What is a bit odd, however, is that if I move the Gtk.main_iteration()
to the __init__ or the configuration function, then it doesn't work.
Anyway, I would still be interested in the "proper" way of handling this.
Cheers,
Zoltán
More information about the cairo
mailing list