Hi all,
I have been trying to write a simple program that
shows a red rectangle on the screen on top of all other windows.
Everything works except for the setting of the red color, I have created a color
struct with the Red value set to full intensity but the color shown on screen is
white. Can anyone please tell me where I am going wrong, is there
something I have omitted?
#include <gtk/gtk.h>
#include <gdk/gdkx.h> int main (int argc, char *argv[] ) { GdkGC *ikgc;
GdkColor ikcol = { 0, 65535, 0, 0 }; gtk_init (&argc, &argv);
ikgc = gdk_gc_new (GDK_ROOT_PARENT
());
gdk_gc_set_function (ikgc,
GDK_COPY);
gdk_gc_set_subwindow (ikgc,
GDK_INCLUDE_INFERIORS);
gdk_gc_set_foreground (ikgc,
&ikcol);
gdk_draw_rectangle (GDK_ROOT_PARENT (), ikgc,
TRUE, 100, 100, 100, 200);
gtk_main
();
return(0); } Thankyou for your time.
IEK.
|