X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xaw%2Fxoptions.c;h=8d9157755c1636a7e03c74d90fc0b1c261869f75;hb=a6d7392c2cb298dcaa0dea4e370e07dbb9f87f07;hp=dbe92c811c7133ce0b9e150e9c1429ab5e5d41e6;hpb=752697385e80b54b2f18216e1c6a584203f8df82;p=xboard.git diff --git a/xaw/xoptions.c b/xaw/xoptions.c index dbe92c8..8d91577 100644 --- a/xaw/xoptions.c +++ b/xaw/xoptions.c @@ -1136,8 +1136,8 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent option[i].max /* w */, shrink ? textHeight : 0 /* h */, option[i].min & 0xE | chain /* chain */); XtSetArg(args[j], XtNlabel, _(option[i].name)); j++; if(option[i].textValue && *option[i].textValue == '#') { // special for buttons of New Variant dialog - char *p, *v, n = option[i].value; - if(n) v = VariantName(n), p = strstr(first.variants, v); + char *p = NULL, *v, n = option[i].value; + if(n >= 0) v = VariantName(n), p = strstr(first.variants, v); XtSetArg(args[j], XtNsensitive, option[i].value >= 0 && (appData.noChessProgram || p && (!*v || strlen(p) == strlen(v) || p[strlen(v)] == ','))); j++; XtSetArg(args[j], XtNborderWidth, (gameInfo.variant == option[i].value)+1); j++; @@ -1225,6 +1225,11 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent 0 /* w */, 0 /* h */, 1 /* chain (always on same row) */); forelast = lastrow; msg = _(option[i].name); // write name on the menu button + if(msg) { if(*msg == '_') msg++; else if(msg[1] == '_') { // kludge to remove GTK shortkut-key indicators + static char buf[MSG_SIZ]; + strncpy(buf, msg, MSG_SIZ); msg = buf + 1; + *msg = *buf; + }} XtSetArg(args[j], XtNmenuName, XtNewString(option[i].name)); j++; XtSetArg(args[j], XtNlabel, msg); j++; option[i].handle = (void*)