Colors and GDK, this the best way?

After muddling with GDK and playing with trying to change the colors
in a drawable area, I got the following segment of code to work so I
can use the "bluegc" to draw blue lines and such. (see bottom)

Java has it nice and simple -

    blue = new Color (r, g, b);

Seems that gtk is a bit more complicated than it should be.  Perhaps
I'm doing it the hard way.  Is there a quicker and better way to get a
gc that I can use to draw lines? 

---- code begins ---

   if (bluegc == NULL) {

        style = drawing_area->style;

        gc_values_mask = GDK_GC_FOREGROUND |
                         GDK_GC_FONT; = 0; = 0xffff; = 0;

        gdk_color_alloc (style->colormap, 

        bluegc = gtk_gc_get (style->depth,      


Get your free address at

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