[cairo] Pango Layout lifecycle questions

Travis Griggs travisgriggs at gmail.com
Tue Aug 10 16:31:51 PDT 2010


The first time I did a Pango binding to Smalltalk, I did it for simple  
cases, and kinda cheated, and didn't bind much. I'm going through and  
doing a more thorough/complete binding now. All of my Pango stuff is  
in the context of Cairo.

The general problem I have, is that it's nice for an application to  
create a Layout object, and then just repeatedly draw it each time a  
display event happens. We map a CairoContext object, but they tend to  
be managed transiently, e.g.

displayCallback
	create cairo context
	draw stuff
	unref context

So the CairoContext tends to be unique or each draw cycle. But the  
apparent life cycle of a PangoLayout object is something like

	create PangoContext from CairoContext
	create Layout from PangoContext

but I don't want to have to recreate the Layout every time I go  
through a display cycle. What's the better approach?

TIA

--
Travis Griggs
Objologist
"Some people are like slinkies, not really good for much, but they can  
bring a smile to your face when you push them down the stairs."



More information about the cairo mailing list