Silence Clang warnings
[xboard.git] / gtk / xoptions.c
index 8df9c44..6e029aa 100644 (file)
@@ -1025,6 +1025,7 @@ GraphEventProc(GtkWidget *widget, GdkEvent *event, gpointer gdata)
        case GDK_SCROLL:
            if(sevent->direction == GDK_SCROLL_UP) button = 4;
            if(sevent->direction == GDK_SCROLL_DOWN) button = 5;
+           w = h = 0; // to keep Clang happy
            break;
        case GDK_MOTION_NOTIFY:
            f = 0;
@@ -1552,7 +1553,11 @@ if(appData.debugMode) printf("n=%d, h=%d, w=%d\n",n,height,width);
                 break;
             } else
             if(!strcmp(option[i].name, "D")) {
-                option[i].handle = (void *) (button = gtk_color_button_new());
+                GdkColor color;
+                char *name;
+               GetWidgetText(&option[i-5], &name);
+                gdk_color_parse(name, &color);
+                option[i].handle = (void *) (button = gtk_color_button_new_with_color(&color));
             } else
             button = gtk_button_new_with_label (_(option[i].name));
             SetWidgetFont(gtk_bin_get_child(GTK_BIN(button)), option[i].font);