PDA

View Full Version : Good GTK library?



CrazyTn
March 6th, 2007, 05:15 AM
Hi, I am new to GTK programming. Trying to program a tetris game atm.

Currently I am using this website as a reference
http://developer.gnome.org/doc/API/2.0/gtk/ch01.html

It is a lil hard to find what I need with it.

Trying to find something to draw on the frame or maybe move widgets around.

lnostdal
March 6th, 2007, 07:14 AM
GDK contains drawing-functions: http://developer.gnome.org/doc/API/2.0/gdk/

..but a very good (better than GDK) library for drawing stuff is Cairo: http://cairographics.org/ .. it produces beautiful results (see the examples .. for instance: http://macslow.thepimp.net/?page_id=23 )

GDK contains the functions needed to combine GDK/GTK and Cairo: http://developer.gnome.org/doc/API/2.0/gdk/gdk-Cairo-Interaction.html

..and here is a complete example:
http://nostdal.org/~lars/programming/c/cairo.c