How to use the GdkColor.pixel



I use the gdk_color_alloc to get the pixel for a color. 
When I use the pixel to set the color, it doesn't work, 
When I just set red,green,blue, it will work.

        GdkColormap* sysmap=gdk_colormap_get_system();
        GdkColor color;
        if (gdk_color_parse   ("#FF0000",&color)) {
                gdk_color_alloc (sysmap,&color) ;
        }
        color.red=0;color.blue=0;color.green=0;
        printf("color:%d\n",color.pixel);
        gtk_widget_modify_bg(widg,GTK_STATE_NORMAL,&color);

looks color.pixel is useless, is that true?



Thanks




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