Re: [Vala] Cairo example for old gtk (2.12.9)

Thanks to Qball Cow and #vala, there are already exists file:;f=src/gtktransition.h;h=c4a05eb9b61da8ee3efcdecab469f499cadbbbf1;hb=HEAD

pancake пишет:
You need gtk 2.14 to get this symbol. You can also implementit in a
define because it's just an accessor to the widget->window struct member.

It's really anoying :)

On May 17, 2009, at 5:56 PM, Харин Роман <HarinRoman kranky-studio ru>

Hi, dear list

Today i try to test Cairo example

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

How to automate this? Any ideas are welcome.

Харин Роман <HarinRoman kranky-studio ru>
jabber://harinr jabber ru
Vala-list mailing list
Vala-list gnome org

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

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