aboutsummaryrefslogtreecommitdiffstats
path: root/src/macmenu.c
diff options
context:
space:
mode:
authorAndrew Choi <[email protected]>2002-10-07 04:00:07 +0000
committerAndrew Choi <[email protected]>2002-10-07 04:00:07 +0000
commit95fb757742d2a6fd51a332e1f3a037dc17e06dfc (patch)
tree446716d801fc9df3d57a397952bfed40132bdeaa /src/macmenu.c
parent496c17d61b1f48506c6e4a34d851121d60033210 (diff)
2002-10-06 Andrew Choi <[email protected]>
* macmenu.c (mac_menu_show): Add j to count menu items; match menu_item_selection to it to find selected item.
Diffstat (limited to 'src/macmenu.c')
-rw-r--r--src/macmenu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/macmenu.c b/src/macmenu.c
index cb51018ce0..128235c027 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -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++;
}
}
}