diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsmenu.m | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index d8dad3e28f8..9d17da43596 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1860,7 +1860,7 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1860 | ========================================================================== */ | 1860 | ========================================================================== */ |
| 1861 | 1861 | ||
| 1862 | DEFUN ("ns-reset-menu", Fns_reset_menu, Sns_reset_menu, 0, 0, 0, | 1862 | DEFUN ("ns-reset-menu", Fns_reset_menu, Sns_reset_menu, 0, 0, 0, |
| 1863 | "Cause the NS menu to be re-calculated.") | 1863 | doc: /* Cause the NS menu to be re-calculated. */) |
| 1864 | () | 1864 | () |
| 1865 | { | 1865 | { |
| 1866 | set_frame_menubar (SELECTED_FRAME (), 1, 0); | 1866 | set_frame_menubar (SELECTED_FRAME (), 1, 0); |
| @@ -1869,30 +1869,38 @@ DEFUN ("ns-reset-menu", Fns_reset_menu, Sns_reset_menu, 0, 0, 0, | |||
| 1869 | 1869 | ||
| 1870 | 1870 | ||
| 1871 | DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, | 1871 | DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, |
| 1872 | "Pop up a deck-of-cards menu and return user's selection.\n\ | 1872 | doc: /* Pop up a deck-of-cards menu and return user's selection. |
| 1873 | POSITION is a position specification. This is either a mouse button event\n\ | 1873 | POSITION is a position specification. This is either a mouse button event |
| 1874 | or a list ((XOFFSET YOFFSET) WINDOW)\n\ | 1874 | or a list ((XOFFSET YOFFSET) WINDOW) |
| 1875 | where XOFFSET and YOFFSET are positions in pixels from the top left\n\ | 1875 | where XOFFSET and YOFFSET are positions in pixels from the top left |
| 1876 | corner of WINDOW's frame. (WINDOW may be a frame object instead of a window.)\n\ | 1876 | corner of WINDOW. (WINDOW may be a window or a frame object.) |
| 1877 | This controls the position of the center of the first line\n\ | 1877 | This controls the position of the top left of the menu as a whole. |
| 1878 | in the first pane of the menu, not the top left of the menu as a whole.\n\ | 1878 | If POSITION is t, it means to use the current mouse position. |
| 1879 | \n\ | 1879 | |
| 1880 | MENU is a specifier for a menu. For the simplest case, MENU is a keymap.\n\ | 1880 | MENU is a specifier for a menu. For the simplest case, MENU is a keymap. |
| 1881 | The menu items come from key bindings that have a menu string as well as\n\ | 1881 | The menu items come from key bindings that have a menu string as well as |
| 1882 | a definition; actually, the \"definition\" in such a key binding looks like\n\ | 1882 | a definition; actually, the \"definition\" in such a key binding looks like |
| 1883 | \(STRING . REAL-DEFINITION). To give the menu a title, put a string into\n\ | 1883 | \(STRING . REAL-DEFINITION). To give the menu a title, put a string into |
| 1884 | the keymap as a top-level element.\n\n\ | 1884 | the keymap as a top-level element. |
| 1885 | You can also use a list of keymaps as MENU.\n\ | 1885 | |
| 1886 | Then each keymap makes a separate pane.\n\ | 1886 | If REAL-DEFINITION is nil, that puts a nonselectable string in the menu. |
| 1887 | When MENU is a keymap or a list of keymaps, the return value\n\ | 1887 | Otherwise, REAL-DEFINITION should be a valid key binding definition. |
| 1888 | is a list of events.\n\n\ | 1888 | |
| 1889 | Alternatively, you can specify a menu of multiple panes\n\ | 1889 | You can also use a list of keymaps as MENU. |
| 1890 | with a list of the form (TITLE PANE1 PANE2...),\n\ | 1890 | Then each keymap makes a separate pane. |
| 1891 | where each pane is a list of form (TITLE ITEM1 ITEM2...).\n\ | 1891 | |
| 1892 | Each ITEM is normally a cons cell (STRING . VALUE);\n\ | 1892 | When MENU is a keymap or a list of keymaps, the return value is the |
| 1893 | but a string can appear as an item--that makes a nonselectable line\n\ | 1893 | list of events corresponding to the user's choice. Note that |
| 1894 | in the menu.\n\ | 1894 | `x-popup-menu' does not actually execute the command bound to that |
| 1895 | With this form of menu, the return value is VALUE from the chosen item.") | 1895 | sequence of events. |
| 1896 | |||
| 1897 | Alternatively, you can specify a menu of multiple panes | ||
| 1898 | with a list of the form (TITLE PANE1 PANE2...), | ||
| 1899 | where each pane is a list of form (TITLE ITEM1 ITEM2...). | ||
| 1900 | Each ITEM is normally a cons cell (STRING . VALUE); | ||
| 1901 | but a string can appear as an item--that makes a nonselectable line | ||
| 1902 | in the menu. | ||
| 1903 | With this form of menu, the return value is VALUE from the chosen item. */) | ||
| 1896 | (position, menu) | 1904 | (position, menu) |
| 1897 | Lisp_Object position, menu; | 1905 | Lisp_Object position, menu; |
| 1898 | { | 1906 | { |