* $Author$
* $Header$
* $Log$
- * Revision 1.4 1987-08-05 14:48:04 ambar
+ * Revision 1.5 1987-08-07 18:09:46 poto
+ * will not enter menu if ->m_entry returns DM_QUIT;
+ * the command args from a submenu command will be passed on to ->m_entry();
+ *
+ * Revision 1.4 87/08/05 14:48:04 ambar
* added latest set of hackery, to fix missing
* newlines, and not being able to quit out of
* the pager.
- *
+ *
* Revision 1.3 87/08/03 05:10:34 wesommer
* This one appears to work.
*
noecho();
cur_ms = make_ms(0); /* So we always have some current menu_screen */
top_menu = m;
- (void) Do_menu(m); /* Run the menu */
+ /* Run the menu */
+ (void) Do_menu(m, 0, (char **) NULL);
endwin();
}
{
cur_ms = NULLMS;
top_menu = m;
- (void) Do_menu(m);
+ /* Run the menu */
+ (void) Do_menu(m, 0, (char **) NULL);
}
/*
* This guy actually puts up the menu
*/
int
-Do_menu(m)
+Do_menu(m, margc, margv)
Menu *m;
+ int margc;
+ char *margv[];
{
struct menu_screen *my_ms, *old_cur_ms;
char argvals[MAX_ARGC][MAX_ARGLEN]; /* This is where args are stored */
/* Entry function gets called with old menu_screen still current */
if (m->m_entry != NULLFUNC)
- m->m_entry(m);
+ if (m->m_entry(m, margc, margv) == DM_QUIT)
+ return DM_NORMAL;
/* The following get run only in curses mode */
if (cur_ms != NULLMS) {
}
else if (command->ml_submenu != NULLMENU) {
/* Else see if it is a submenu */
- quitflag = Do_menu(command->ml_submenu);
+ quitflag = Do_menu(command->ml_submenu, argc, argv);
}
else {
/* If it's got neither, something is wrong */