Silence warnings
[xboard.git] / gtk / xoptions.c
index 0424147..5ae8ddb 100644 (file)
@@ -270,6 +270,22 @@ SetWidgetFont (GtkWidget *w, char **s)
 }
 
 void
+ApplyFont (Option *opt, char *font)
+{
+    GtkWidget *w = NULL;
+    if(!font && opt->font) font = *opt->font;
+    if(!font) return;
+    switch(opt->type) {
+      case ListBox:
+      case Label:   w = opt->handle; break;
+      case Button:  if(opt->handle) w = gtk_bin_get_child(GTK_BIN(opt->handle)); break;
+      case TextBox: w = (GtkWidget *) opt->textValue; if(!w) w = opt->handle; break;
+      default: ;
+    }
+    if(w && font) SetWidgetFont(w, &font);
+}
+
+void
 SetListBoxItem (GtkListStore *store, int n, char *msg)
 {
     GtkTreeIter iter;
@@ -599,6 +615,11 @@ AppendColorized (Option *opt, char *s, int count)
     static GtkTextIter end;
     static GtkTextTag *fgTags[8], *bgTags[8], *font, *bold, *normal, *attr = NULL;
 
+    if(!s) {
+       font = NULL;
+       return;
+    }
+
     if(!font) {
        font = gtk_text_buffer_create_tag(opt->handle, NULL, "font", appData.icsFont, NULL);
        gtk_widget_modify_base(GTK_WIDGET(opt->textValue), GTK_STATE_NORMAL, &backgroundColor);