]> andersk Git - moira.git/commitdiff
will not enter menu if ->m_entry returns DM_QUIT;
authorpoto <poto>
Fri, 7 Aug 1987 18:09:46 +0000 (18:09 +0000)
committerpoto <poto>
Fri, 7 Aug 1987 18:09:46 +0000 (18:09 +0000)
the command args from a submenu command will be passed on to ->m_entry();

clients/moira/menu.c

index bd852fa1206a99e8d44cd19dc0ab7367a010e9ce..d695caf68a5212d6af1c6d0f1e871e0719918578 100644 (file)
@@ -7,11 +7,15 @@
  * $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.
  * 
@@ -83,7 +87,8 @@ Start_menu(m)
     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();
 }
 
@@ -93,7 +98,8 @@ Start_no_menu(m)
 {
     cur_ms = NULLMS;
     top_menu = m;
-    (void) Do_menu(m);
+    /* Run the menu */
+    (void) Do_menu(m, 0, (char **) NULL);
 }
 
 /*
@@ -146,8 +152,10 @@ destroy_ms(ms)
  * 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 */
@@ -161,7 +169,8 @@ Do_menu(m)
 
     /* 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) {
@@ -252,7 +261,7 @@ Do_menu(m)
        }
        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 */
This page took 0.041589 seconds and 5 git commands to generate.