hello world problem



I am trying to draw some simple text on a widget using gtk_draw_string. However the string is not displayed;
the window remains empty. Any suggestions as to what I do wrong?

#include <gtk/gtk.h>

int main(int argc, char *argv[])
{
 GtkWidget *window;
 GdkGC *gc;
 GdkFont* gfont;
 gtk_init (&argc, &argv);
gfont=gdk_font_load("-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1");
 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 gtk_widget_show (window);
 gc=gdk_gc_new(window->window);
 gdk_draw_string (window->window, gfont,gc, 0,0,"hello world");
 gtk_widget_draw (window, NULL);
 gtk_main ();
 return(0);
}

Compile-command:
gcc temp.c -o temp `gtk-config --cflags --libs`


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





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