An underscore in the menu text should not be counted when deciding where
to clip the text to make the menu bar fit the window width. If clipping
would occur immediately after an underscore, just clip off the first
character to get the mnemonic back in view. (This makes _n from the
Engine menu.)
top--;
msg = _(option[i].name); // write name on the menu button
#ifndef OSXAPP
- if(tinyLayout) { strcpy(def, msg); def[tinyLayout] = NULLCHAR; msg = def; } // clip menu text to keep menu bar small
+ if(tinyLayout) { // clip menu text to keep menu bar small
+ int clip = tinyLayout + 1;
+ strcpy(def, msg + (msg[clip-1] == '_'));
+ def[clip] = NULLCHAR; msg = def;
+ }
#endif
// XtSetArg(args[j], XtNmenuName, XtNewString(option[i].name)); j++;
// XtSetArg(args[j], XtNlabel, msg); j++;