X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=3a29431e965f7b2cb1d71aa338d4c02d1d55a8fc;hb=406c6ab4dfbef3ace867dbe2ffd54072e4e48113;hp=4f68db7125e7bc2e1890b1fa87a8aab1c004960b;hpb=51d2fca3f8d1d539b75c21ef49c84dd1d85b32e6;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 4f68db7..3a29431 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -279,10 +279,9 @@ ApplyFont (Option *opt, char *font) 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 = opt->textValue; break; + case TextBox: w = opt->textValue; if(!w) w = opt->handle; break; default: ; } -printf("set font %s\n", font); if(w && font) SetWidgetFont(w, &font); } @@ -616,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);