is that the only error message ? error: "cannot open display: :0.0"
gtk rarely gives only one. Anyway, the program looks fine -- unless some of those statements are gtk-+2.0.
note: doing everything as root is BAD practice, that's all. Most things work as root.
Is it possible for you to upgrade to FC3? and trythis again. This is the command I had to use to compile your program.
$ gcc -o helloworld helloworld.c `pkg-config gtk+-2.0 --libs --cflags`
Notice the change from 'gtk-config...' to 'pkg-config gtk+-2.0...'
(please answer - is that the only error message)