Problem setting the forground.



I am using GTK 1.2 for an embedded project and I can seem to set the forground color correctly.

void draw_header (GtkWidget *widget){
    GdkGCValues gcv;
    GdkGC *gc;
    GdkColor gdkBlue;
    gdk_color_parse("blue", &gdkBlue);
    gc = gdk_gc_new(widget->window);
    gdk_gc_set_foreground(gc,&gdkBlue);   
    GdkRectangle update_rect;
    int width=widget->allocation.width;
    int height=widget->allocation.height;
    update_rect.x =0;
    update_rect.y =0;
    update_rect.width=width;
     update_rect.height = height;
    gdk_draw_rectangle (pixmap, gc, TRUE,0, 0,width, 10);
    gtk_widget_draw (widget, &update_rect);
}
No matter what color I put in I get a green bar!
Any ideas or suggestions?


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