[cairo] Cairo, Python and GTK widgets within a context

Kalle Vahlman kalle.vahlman at gmail.com
Sat Dec 15 08:43:28 PST 2007


2007/12/15, Donn <donn.ingle at gmail.com>:
> Hi,
>  Is there any way to "house" a GTK widget (say a button, or a text entry
> field) within a GDK DrawingArea (for which I can get a cairo context)?

A DrawingArea isn't a container, so not really (at the moment at
least). However, if you take a dip and learn how to write a container
in GTK (it's not really that difficult, though it requires to learn
how the widget system works), it's possible to write a canvas widget
that contains the other widgets...

> I want to see if I can mix-in some GTK widgets and place them on the canvas. I
> am aiming at having them obey the matrix of the current context, so they can
> scale and rotate etc.

...though to get this far you'll either have to do uglish things to
acquire the widget's drawing or wait for the offscreen rendering patch
to be in a GTK+ release to do it properly. And even after that, you'll
get the input problem, ie. you need to transform also the input events
(mouse clicks etc) for the widgets...

> Any hope?

Hope: yes, practical implementation: at least not yet, unfortunately.

-- 
Kalle Vahlman, zuh at iki.fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi


More information about the cairo mailing list