A new primitive to create an item in a given menu was added to do this.
{
int i=0;
char *p;
-#if 0
if(appData.icsActive || appData.recentEngines <= 0) return;
recentEngines = strdup(list);
while (*list) {
p = strchr(list, '\n'); if(p == NULL) break;
- if(i == 0) AppendMenuItem("----", "----", NULL); // at least one valid item to add
+ if(i == 0) AppendMenuItem("----", 0); // at least one valid item to add
*p = 0;
- AppendMenuItem(list, "recent", (MenuProc *) i);
+ AppendMenuItem(list, i);
i++; *p = '\n'; list = p + 1;
}
-#endif
}
Enables icsEnables[] = {
extern Menu menuBar[];
+void AppendEnginesToMenu P((char *list));
void LoadGameProc P((void));
void LoadNextGameProc P((void));
void LoadPrevGameProc P((void));
void EvalGraphProc P((void));
void CreateMainMenus P((Menu *mb));
-void AppendMenuItem P((char *text, char *name, MenuProc *action));
+void AppendMenuItem P((char *text, int n));
void CreateMenuButton P((char *name, Menu *mb));
MenuItem *MenuNameToItem P((char *menuName));
void SetMenuEnables P((Enables *enab));
XtSetArg(args[1], XtNforeground, &buttonForegroundPixel);
XtGetValues(optList[18].handle, args, 2);
}
+ AppendEnginesToMenu(appData.recentEngineList);
xBoardWindow = XtWindow(boardWidget);
}
void
+AppendMenuItem (char *msg, int n)
+{
+ CreateMenuItem((Widget) optList[6].textValue, msg, (XtCallbackProc) MenuEngineSelect, n);
+}
+
+void
SetupDropMenu ()
{
int i, j, count;
void SendToProgram P((char *message, ChessProgramState *cps));
void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b); // from xoptions.c
void TypeInProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
+Widget CreateMenuItem P((Widget menu, char *msg, XtCallbackProc CB, int n));
void WheelProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
void TabProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
void GenericMenu P((Widget w, XEvent *event, String *prms, Cardinal *nprms));