]> code.delx.au - gnu-emacs/blobdiff - mac/src/macmenu.c
*** empty log message ***
[gnu-emacs] / mac / src / macmenu.c
index 41536e466aa6fb8ab33eb98a8d75c186db33daa1..b7ed55adcecf627a70e73cee69aa74fe40adbd79 100644 (file)
@@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA.  */
 #include "buffer.h"
 #include "charset.h"
 #include "coding.h"
+#include "keymap.h"
 
 #include <MacTypes.h>
 #include <Menus.h>
@@ -735,7 +736,7 @@ cached information about equivalent key sequences.")
 
       /* Search for a string appearing directly as an element of the keymap.
         That string is the title of the menu.  */
-      prompt = map_prompt (keymap);
+      prompt = Fkeymap_prompt (keymap);
       if (NILP (title) && !NILP (prompt))
        title = prompt;
 
@@ -763,7 +764,7 @@ cached information about equivalent key sequences.")
 
          maps[i++] = keymap = get_keymap (Fcar (tem));
 
-         prompt = map_prompt (keymap);
+         prompt = Fkeymap_prompt (keymap);
          if (NILP (title) && !NILP (prompt))
            title = prompt;
        }
@@ -1702,14 +1703,13 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
   SetPort (FRAME_MAC_WINDOW (f));
   LocalToGlobal (&pos);
 
-  /* No selection has been chosen yet.  */
-  menu_item_selection = 0;
-
   InsertMenu (menu, -1);
 
   /* Display the menu.  */
   menu_item_selection = LoWord (PopUpMenuSelect (menu, pos.v, pos.h, 0));
 
+  GetMenuItemRefCon (menu, menu_item_selection, &menu_item_selection);
+
   DeleteMenu (POPUP_SUBMENU_ID);
   
 #if 0