]> code.delx.au - gnu-emacs/commitdiff
2002-10-06 Andrew Choi <akochoi@shaw.ca>
authorAndrew Choi <akochoi@shaw.ca>
Mon, 7 Oct 2002 04:00:07 +0000 (04:00 +0000)
committerAndrew Choi <akochoi@shaw.ca>
Mon, 7 Oct 2002 04:00:07 +0000 (04:00 +0000)
        * macmenu.c (mac_menu_show): Add j to count menu items; match
        menu_item_selection to it to find selected item.

src/ChangeLog
src/macmenu.c

index a609251ed0889a6faa8b56dcc755ce2d1ebbff30..b336f3b341380aef29a79d817dbb1420fcc8d420 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-06  Andrew Choi  <akochoi@shaw.ca>
+
+       * macmenu.c (mac_menu_show): Add j to count menu items; match
+       menu_item_selection to it to find selected item.
+
 2002-10-06  Jan D.  <jan.h.d@swipnet.se>
 
        * xterm.c (XTread_socket): Fix from 2002-10-03 didn't cover all
index cb51018ce00aaec2bbe01abcbee6d58f1baefd7d..128235c027b3a07884c3e9785770b62343ac8693 100644 (file)
@@ -1839,6 +1839,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
   if (menu_item_selection != 0)
     {
       Lisp_Object prefix, entry;
+      int j = 1;
 
       prefix = entry = Qnil;
       i = 0;
@@ -1860,6 +1861,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
              prefix
                = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
              i += MENU_ITEMS_PANE_LENGTH;
+             j += 2;
            }
          /* Ignore a nil in the item list.
             It's meaningful only for dialog boxes.  */
@@ -1869,7 +1871,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
            {
              entry
                = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE];
-             if (menu_item_selection == i)
+             if (menu_item_selection == j)
                {
                  if (keymaps != 0)
                    {
@@ -1885,6 +1887,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
                  return entry;
                }
              i += MENU_ITEMS_ITEM_LENGTH;
+             j++;
            }
        }
     }