Using Cairo from introspected GTK3




Hi,

When using GTK3 via PyGI, I can connect a method to the
"draw" signal of a GtkWidget and this method will receive
a cairo.Context object. If I do some cairo work just
using this object, it works fine.

The problem is that I'm trying to do some drawing using
this cairo.Context and the cairo.Pattern taken from the
"background-image" property of the GtkStyleContext of
another widget. When I try, for example, to do a
set_source using this pattern I get

TypeError: must be cairo.Pattern, not Pattern

So it seems I'm trying to mix introspected and
non-introspected Cairos here, and this is not acceptable.
What should I be doing in this case?

I also tried to obtain the pattern using the
get_background_pattern() method of the widget GdkWindow,
but this gave me a

TypeError: Couldn't find conversion for foreign struct 'cairo.Pattern'

Thanks in advance,
Marcelo


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]