[Vala] Cairo example for old gtk (2.12.9)



Hi, dear list

Today i try to test Cairo example http://live.gnome.org/Vala/CairoSample.

But in Ubuntu hardy (8.4.2) Gtk have version 2.12.9. This lead to this
sample became uncompilable.

/tmp/ccWdOcX9.o: In function `cairo_sample_on_expose':
main.vala.c:(.text+0x11b): undefined reference to `gtk_widget_get_window'
collect2: выполнение ld завершилось с кодом возврата 1
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)

Seems to be `gtk_widget_get_window' appered only in Gtk+ 2.14. In
generated code this look like:
   ctx = gdk_cairo_create ((GdkDrawable*) gtk_widget_get_window
      ((GtkWidget*) da));

But hardy is only one years old.
So it's need to manually modify generated code:

    ctx = gdk_cairo_create (GDK_DRAWABLE(((GtkWidget*)da)->window));

Which compile without any problem by:
  gcc CairoSample.c `pkg-config --cflags --libs gtk+-2.0 cairo` -Wall -o
cairosample

How to automate this? Any ideas are welcome.

-- 
Харин Роман <HarinRoman kranky-studio ru>
jabber://harinr jabber ru



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