Cairo How to start

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cairo How to start

Sylvain pralon
Hi,

I tried to migrate my application which used to draw some standard
geometric visual works shapes to cairo.
Unfortunatelly, I load CairoGraphics from the store and it seems that :
    aGraphicsContext respondsTo: #cairoContext
always returns false so I am still using standard shapes.
I load Cairo demo too and I have an error saying that an external method
is missing (relative to libcairo).

Please help me.
Cairo looks beautiful and I just want to use it.

Thanks

Sylvain

Reply | Threaded
Open this post in threaded view
|

Re: Cairo How to start

Karsten Kusche
Hi Sylvain,

i'm trying to get Cairo working here too atm.
what i did in Windows was to load gtk+ from
http://gladewin32.sourceforge.net/modules/news/  (the latest)

even though it added itself to the PATH cairo had problems finding the
cairolib so i had to manually add the folder to the #libraryDirectories
in LibCairo (select the class and change this in the attributes that are
listed)

on my Mac i used MacPorts like shown on
http://www.cairographics.org/download/. for pango i also used ports.

This should make cairo run.
I donno if I did anything wrong, so please correct me. i'm having some
problems here too, maybe it's due to a wrong installation.

Kind Regards
Karsten



Sylvain Pralon wrote:

> Hi,
>
> I tried to migrate my application which used to draw some standard
> geometric visual works shapes to cairo.
> Unfortunatelly, I load CairoGraphics from the store and it seems that :
>    aGraphicsContext respondsTo: #cairoContext
> always returns false so I am still using standard shapes.
> I load Cairo demo too and I have an error saying that an external
> method is missing (relative to libcairo).
>
> Please help me.
> Cairo looks beautiful and I just want to use it.
>
> Thanks
>
> Sylvain
>
>

--
Karsten Kusche - Dipl.Inf. - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812

Reply | Threaded
Open this post in threaded view
|

Re: Cairo How to start

Travis Griggs-3
In reply to this post by Sylvain pralon
On Sep 28, 2007, at 3:35, Sylvain Pralon wrote:

Hi,

I tried to migrate my application which used to draw some standard geometric visual works shapes to cairo.
Unfortunatelly, I load CairoGraphics from the store and it seems that :
   aGraphicsContext respondsTo: #cairoContext
always returns false so I am still using standard shapes.
I load Cairo demo too and I have an error saying that an external method is missing (relative to libcairo).

Can you browse implementors of cairoContext? Are there any? If not, I think something went wrong in your load.

When you do get it loaded... I'd like to recommend this pattern:

YourVisualPart>>displayOn: aGC
(aGC respondsTo: #cairoContext)
ifTrue: [aGC newCairoContextWhile: [:cr | "do your cairo drawing code here"]]
ifFalse: ["do your classical GC drawing code here"]

Using the newCairoContextWhile: API ensures a timely finalization of external resources.

Please help me.
Cairo looks beautiful and I just want to use it.

Me too. :)

--
Travis Griggs
Objologist
10 2 letter words: "If it is to be, it is up to me"