* macmenu.c (mac_menu_show): Add j to count menu items; match
menu_item_selection to it to find selected item.
+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
if (menu_item_selection != 0)
{
Lisp_Object prefix, entry;
+ int j = 1;
prefix = entry = Qnil;
i = 0;
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. */
{
entry
= XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE];
- if (menu_item_selection == i)
+ if (menu_item_selection == j)
{
if (keymaps != 0)
{
return entry;
}
i += MENU_ITEMS_ITEM_LENGTH;
+ j++;
}
}
}