comparison man/lispref/menus.texi @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents 8de8e3f6228a
children f43f9ca6c7d9
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
1 @c -*-texinfo-*- 1 @c -*-texinfo-*-
2 @c This is part of the XEmacs Lisp Reference Manual. 2 @c This is part of the XEmacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
4 @c Copyright (C) 1995 Sun Microsystems. 4 @c Copyright (C) 1995 Sun Microsystems.
5 @c See the file lispref.texi for copying conditions. 5 @c See the file lispref.texi for copying conditions.
6 @setfilename ../../info/menu.info 6 @setfilename ../../info/menu.info
7 @node Menus, Dialog Boxes, Keymaps, Top 7 @node Menus, Dialog Boxes, Keymaps, Top
8 @chapter Menus 8 @chapter Menus
364 also specifies a particular item to be modified. For example, 364 also specifies a particular item to be modified. For example,
365 @code{("File" "Save")} means the menu item called ``Save'' under the 365 @code{("File" "Save")} means the menu item called ``Save'' under the
366 top-level ``File'' menu. @code{("Menu" "Foo" "Item")} means the menu 366 top-level ``File'' menu. @code{("Menu" "Foo" "Item")} means the menu
367 item called ``Item'' under the ``Foo'' submenu of ``Menu''. 367 item called ``Item'' under the ``Foo'' submenu of ``Menu''.
368 368
369 @defun add-submenu menu-path submenu &optional before 369 @defun add-submenu menu-path submenu &optional before in-menu
370 This function adds a menu to the menubar or one of its submenus. If the 370 This function adds a menu to the menubar or one of its submenus. If the
371 named menu exists already, it is changed. 371 named menu exists already, it is changed.
372 372
373 @var{menu-path} identifies the menu under which the new menu should be 373 @var{menu-path} identifies the menu under which the new menu should be
374 inserted. If @var{menu-path} is @code{nil}, then the menu will be added 374 inserted. If @var{menu-path} is @code{nil}, then the menu will be added
377 @var{submenu} is the new menu to add (@pxref{Menu Format}). 377 @var{submenu} is the new menu to add (@pxref{Menu Format}).
378 378
379 @var{before}, if provided, is the name of a menu before which this menu 379 @var{before}, if provided, is the name of a menu before which this menu
380 should be added, if this menu is not on its parent already. If the menu 380 should be added, if this menu is not on its parent already. If the menu
381 is already present, it will not be moved. 381 is already present, it will not be moved.
382 @end defun 382
383 383 If @var{in-menu} is present use that instead of @code{current-menubar}
384 @defun add-menu-button menu-path menu-leaf &optional before 384 as the menu to change.
385 @end defun
386
387 @defun add-menu-button menu-path menu-leaf &optional before in-menu
385 This function adds a menu item to some menu, creating the menu first if 388 This function adds a menu item to some menu, creating the menu first if
386 necessary. If the named item exists already, it is changed. 389 necessary. If the named item exists already, it is changed.
387 390
388 @var{menu-path} identifies the menu under which the new menu item should 391 @var{menu-path} identifies the menu under which the new menu item should
389 be inserted. 392 be inserted.
391 @var{menu-leaf} is a menubar leaf node (@pxref{Menu Format}). 394 @var{menu-leaf} is a menubar leaf node (@pxref{Menu Format}).
392 395
393 @var{before}, if provided, is the name of a menu before which this item 396 @var{before}, if provided, is the name of a menu before which this item
394 should be added, if this item is not on the menu already. If the item 397 should be added, if this item is not on the menu already. If the item
395 is already present, it will not be moved. 398 is already present, it will not be moved.
396 @end defun 399
397 400 If @var{in-menu} is present use that instead of @code{current-menubar}
398 @defun delete-menu-item menu-item-path 401 as the menu to change.
402 @end defun
403
404 @defun delete-menu-item menu-item-path &optional from-menu
399 This function removes the menu item specified by @var{menu-item-path} 405 This function removes the menu item specified by @var{menu-item-path}
400 from the menu hierarchy. 406 from the menu hierarchy.
407
408 If @var{from-menu} is present use that instead of @code{current-menubar}
409 as the menu to change.
401 @end defun 410 @end defun
402 411
403 @defun enable-menu-item menu-item-path 412 @defun enable-menu-item menu-item-path
404 This function makes the menu item specified by @var{menu-item-path} be 413 This function makes the menu item specified by @var{menu-item-path} be
405 selectable. 414 selectable.
524 533
525 @node Pop-Up Menus 534 @node Pop-Up Menus
526 @section Pop-Up Menus 535 @section Pop-Up Menus
527 @cindex pop-up menu 536 @cindex pop-up menu
528 537
529 @defun popup-menu menu-desc 538 @defun popup-menu menu-description &optional event
530 This function pops up a menu specified by @var{menu-desc}, which is a 539 This function pops up a menu specified by @var{menu-description}, which
531 menu description (@pxref{Menu Format}). The menu is displayed at the 540 is a menu description (@pxref{Menu Format}). The menu is displayed at
532 current mouse position. 541 the current mouse position.
533 @end defun 542 @end defun
534 543
535 @defun popup-menu-up-p 544 @defun popup-menu-up-p
536 This function returns @code{t} if a pop-up menu is up, @code{nil} 545 This function returns @code{t} if a pop-up menu is up, @code{nil}
537 otherwise. 546 otherwise.
577 @end defvar 586 @end defvar
578 587
579 The following convenience functions are provided for displaying 588 The following convenience functions are provided for displaying
580 pop-up menus. 589 pop-up menus.
581 590
582 @defun popup-buffer-menu event 591 @deffn Command popup-buffer-menu event
583 This function pops up a copy of the @samp{Buffers} menu (from the menubar) 592 This function pops up a copy of the @samp{Buffers} menu (from the menubar)
584 where the mouse is clicked. 593 where the mouse is clicked. It should be bound to a mouse button event.
585 @end defun 594 @end deffn
586 595
587 @defun popup-menubar-menu event 596 @deffn Command popup-menubar-menu event
588 This function pops up a copy of menu that also appears in the menubar. 597 This function pops up a copy of menu that also appears in the menubar.
589 @end defun 598 It should be bound to a mouse button event.
599 @end deffn
590 600
591 @node Menu Accelerators 601 @node Menu Accelerators
592 @section Menu Accelerators 602 @section Menu Accelerators
593 @cindex menu accelerators 603 @cindex menu accelerators
594 @cindex keyboard menu accelerators 604 @cindex keyboard menu accelerators
649 for more information about how to modify the menu traversal keys. 659 for more information about how to modify the menu traversal keys.
650 660
651 @node Menu Accelerator Functions 661 @node Menu Accelerator Functions
652 @subsection Menu Accelerator Functions 662 @subsection Menu Accelerator Functions
653 663
654 @defun accelerate-menu 664 @deffn Command accelerate-menu
655 Make the menubar immediately active and place the cursor on the left most entry 665 Make the menubar immediately active and place the cursor on the left most entry
656 in the top level menu. Menu items can be selected as usual. 666 in the top level menu. Menu items can be selected as usual.
657 @end defun 667 @end deffn
658 668
659 @defvar menu-accelerator-enabled 669 @defvar menu-accelerator-enabled
660 Whether menu accelerator keys can cause the menubar to become active. 670 Whether menu accelerator keys can cause the menubar to become active.
661 671
662 If @code{menu-force} or @code{menu-fallback}, then menu accelerator keys can 672 If @code{menu-force} or @code{menu-fallback}, then menu accelerator keys can