diff options
| author | Richard M. Stallman | 1996-01-17 17:23:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-01-17 17:23:41 +0000 |
| commit | 2368fc6ff0d30dfee83def9e24b20b7516ef2b51 (patch) | |
| tree | 5ee12bb24ee710d0ffc5c37d442d7ebd8b3b4f8d | |
| parent | bd98ada94c137f0764431060427e7279f97a51ec (diff) | |
| download | emacs-2368fc6ff0d30dfee83def9e24b20b7516ef2b51.tar.gz emacs-2368fc6ff0d30dfee83def9e24b20b7516ef2b51.zip | |
Explain avoiding x-popup-menu for menu bar submenu.
| -rw-r--r-- | lispref/frames.texi | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lispref/frames.texi b/lispref/frames.texi index dd0b451aa8a..377e4fef98f 100644 --- a/lispref/frames.texi +++ b/lispref/frames.texi | |||
| @@ -1032,15 +1032,26 @@ Each @var{line} should be a string, and each @var{item} should be the | |||
| 1032 | value to return if that @var{line} is chosen. | 1032 | value to return if that @var{line} is chosen. |
| 1033 | @end defun | 1033 | @end defun |
| 1034 | 1034 | ||
| 1035 | @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu if | 1035 | @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu if |
| 1036 | a prefix key with a menu keymap would do the job. If you use a menu | 1036 | a prefix key with a menu keymap would do the job. If you use a menu |
| 1037 | keymap to implement a menu, @kbd{C-h c} and @kbd{C-h a} can see the | 1037 | keymap to implement a menu, @kbd{C-h c} and @kbd{C-h a} can see the |
| 1038 | individual items in that menu and provide help for them. If instead you | 1038 | individual items in that menu and provide help for them. If instead you |
| 1039 | implement the menu by defining a command that calls @code{x-popup-menu}, | 1039 | implement the menu by defining a command that calls @code{x-popup-menu}, |
| 1040 | the help facilities cannot know what happens inside that command, so | 1040 | the help facilities cannot know what happens inside that command, so |
| 1041 | they cannot give any help for the menu's items. This is the reason why | 1041 | they cannot give any help for the menu's items. |
| 1042 | all the menu bar items are normally implemented with menu keymaps | 1042 | |
| 1043 | (@pxref{Menu Keymaps}). | 1043 | The menu bar mechanism, which lets you switch between submenus by |
| 1044 | moving the mouse, cannot look within the definition of a command to see | ||
| 1045 | that it calls @code{x-popup-menu}. Therefore, if you try to implement a | ||
| 1046 | submenu using @code{x-popup-menu}, it cannot work with the menu bar in | ||
| 1047 | an integrated fashion. This is why all menu bar submenus are | ||
| 1048 | implemented with menu keymaps within the parent menu, and never with | ||
| 1049 | @code{x-popup-menu}. @xref{Menu Bar}, | ||
| 1050 | |||
| 1051 | If you want a menu bar submenu to have contents that vary, you should | ||
| 1052 | still use a menu keymap to implement it. To make the contents vary, add | ||
| 1053 | a hook function to @code{menu-bar-update-hook} to update the contents of | ||
| 1054 | the menu keymap as necessary. | ||
| 1044 | 1055 | ||
| 1045 | @node Dialog Boxes | 1056 | @node Dialog Boxes |
| 1046 | @section Dialog Boxes | 1057 | @section Dialog Boxes |