aboutsummaryrefslogtreecommitdiffstats
path: root/src/macmenu.c
diff options
context:
space:
mode:
authorAndrew Choi2002-10-07 04:00:07 +0000
committerAndrew Choi2002-10-07 04:00:07 +0000
commit95fb757742d2a6fd51a332e1f3a037dc17e06dfc (patch)
tree446716d801fc9df3d57a397952bfed40132bdeaa /src/macmenu.c
parent496c17d61b1f48506c6e4a34d851121d60033210 (diff)
downloademacs-95fb757742d2a6fd51a332e1f3a037dc17e06dfc.tar.gz
emacs-95fb757742d2a6fd51a332e1f3a037dc17e06dfc.zip
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.
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 cb51018ce00..128235c027b 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1839,6 +1839,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1839 if (menu_item_selection != 0) 1839 if (menu_item_selection != 0)
1840 { 1840 {
1841 Lisp_Object prefix, entry; 1841 Lisp_Object prefix, entry;
1842 int j = 1;
1842 1843
1843 prefix = entry = Qnil; 1844 prefix = entry = Qnil;
1844 i = 0; 1845 i = 0;
@@ -1860,6 +1861,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1860 prefix 1861 prefix
1861 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; 1862 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
1862 i += MENU_ITEMS_PANE_LENGTH; 1863 i += MENU_ITEMS_PANE_LENGTH;
1864 j += 2;
1863 } 1865 }
1864 /* Ignore a nil in the item list. 1866 /* Ignore a nil in the item list.
1865 It's meaningful only for dialog boxes. */ 1867 It's meaningful only for dialog boxes. */
@@ -1869,7 +1871,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1869 { 1871 {
1870 entry 1872 entry
1871 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; 1873 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE];
1872 if (menu_item_selection == i) 1874 if (menu_item_selection == j)
1873 { 1875 {
1874 if (keymaps != 0) 1876 if (keymaps != 0)
1875 { 1877 {
@@ -1885,6 +1887,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1885 return entry; 1887 return entry;
1886 } 1888 }
1887 i += MENU_ITEMS_ITEM_LENGTH; 1889 i += MENU_ITEMS_ITEM_LENGTH;
1890 j++;
1888 } 1891 }
1889 } 1892 }
1890 } 1893 }