Re: problem refreshing cairo surface

Kalle Vahlman <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAOPOHQN2sRM0NrE0bdo+ZipaLg9VuztNTD6ef1sgZcc0OpjjPg@mail.gmail.com>
2011/11/12 Zoltán Vörös <[email protected]>:
> Hi All,
>
> I believe, this is a trivial problem, but lacking experience, I can't solve
> it, and I was wondering whether someone could lend a hand here. In short, I
> have a python class that just initialises a drawing area, and I would like
> to use it from somewhere else. It looks like this
[snip code]

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. Otherwise the principle seems
what is generally used; have a cache of similar surface to update
whenever and invalidate the widget for painting that cache surface
when needed.

But as a general advice, cairo contexes are not meant to be stored for
longer periods. Just create a new one whenever doing rendering. I'm
not sure if that is your problem but you might as well fix that first.

-- 
Kalle Vahlman, [email protected]
Powered by http://movial.com
Interesting stuff at http://sandbox.movial.com
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.