[sugar] New version of piemenu.py, and some cairo questions
Wed Feb 28 00:22:32 EST 2007
Hurray, I've got pie menus reading icons from png files
(cairo.ImageSurface.create_from_png) and centering the icons above the
I'd love to know the trick to reading SVG files, please -- that would
really work well with pie menus, especially once I get some cool scaling
and rotating feedback implemented.
Is there a way to load an SVG file into a surface cache with a
How do you measure an SVG file's size, or do you have to know what size
to render it?
Can you please recommend a good source of documentation about pycairo
and pango from a python programmer's point of view?
I've found the gtk doc that has some of this stuff, but it seems to be
missing a lot of the lower level cairo stuff, just pangocairo
documentation without links into the cairo module documentation.
For example, this tells about paingocairocontext but has no
documentation link for cairo.Context...
Thanks a lot for the help!
Marco Pesenti Gritti wrote:
> On Mon, 2007-02-26 at 18:35 -0800, Don Hopkins wrote:
>> So here is a naive resource management question:
>> What is the best way to configure and pass icons and graphical resources
>> into cairo based widgets, measure and draw them on the screen efficiently?
>> (It would be nice if the same icon is used in a lot of places, it only
>> got loaded once, and stuff like that...)
> What we are currently doing for our icons is to render them (they are
> svg) on a buffer context, created like this:
> target = ctx.get_target()
> buf = target.create_similar(cairo.CONTENT_COLOR_ALPHA, w, h)
> And then copy them on the widget context with:
> ctx.set_source_surface(buf, x, y)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Sugar-devel