Cairo with GTK2 and GTK3

Ken Resander <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
I am a cairo newbie on Ubuntu 12.04 LTS using GTK+3.0.

I have read 'Changes that need to be done at the time of the switch' at Gnome Dev Centre which explains what is new for GTK+3.0. It mentions that "expose-event" signal has been replaced by a new "draw" signal. That is very clear, but I have seen examples in other forums of expose event used together with gtk_drawing_area_new, so I tried using it too:

...
darea = gtk_drawing_area_new();
gtk_container_add(GTK_CONTAINER(window), darea);
g_signal_connect(G_OBJECT(darea), "expose-event",
                    G_CALLBACK(on_expose_event), &h);

It compiled and built but generated 
(gv:2938): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.32.3/./gobject/gsignal.c:2455: signal `expose-event' is invalid for instance `0x78d020' when executing the g_signal_connect. (0x78d020 refers to darea). That suggests that expose event does not work/is not available for GTK+3.0. Is this so?

Event handlers for expose-event have a GdkEventExpose *event parameter that allows 'regions' to be updated. The draw handler does not have this parameter. Has updating regions been dropped in GTK+3.0 or can it be done in some other way? If so, where can I read about it?

GTK+3.0 came with Ubuntu 12.04LTS. I will also need to support GTK+2. Can GTK 3 and GTK 2 coexist on the same Ubuntu/Linux PC, for example as different shared object libraries or do I need to use two PCs? 

I could build GTK3-only and GTK2-only versions or build a combined version that switches on gtk version as needed. Pros and cons?

Ken

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.