comparison lisp/menubar.el @ 707:a307f9a2021d

[xemacs-hg @ 2001-12-20 05:49:28 by andyp] sync with 21-4-6-windows
author andyp
date Thu, 20 Dec 2001 05:49:48 +0000
parents 7039e6323819
children 9caf26dd924f
comparison
equal deleted inserted replaced
706:c9bf82d465b5 707:a307f9a2021d
669 (funcall (event-function response) (event-object response)) 669 (funcall (event-function response) (event-object response))
670 If no response was received, nil is returned. 670 If no response was received, nil is returned.
671 671
672 MENU-DESC and EVENT are as in the call to `popup-menu'." 672 MENU-DESC and EVENT are as in the call to `popup-menu'."
673 ;; partially stolen from w3 673 ;; partially stolen from w3
674
675 ;; This function is way gross and assumes to much about menu
676 ;; processing that is X specific. Under mswindows popup menus behave
677 ;; in reasonable ways that you can't obstruct.
674 (let ((echo-keystrokes 0) 678 (let ((echo-keystrokes 0)
675 new-event) 679 new-event)
676 (popup-menu menu-desc event) 680 (popup-menu menu-desc event)
677 (catch 'popup-done 681 (catch 'popup-done
678 (while t 682 (while t
679 (setq new-event (next-command-event new-event)) 683 (setq new-event (next-command-event new-event))
680 (cond ((misc-user-event-p new-event) 684 (cond ((misc-user-event-p new-event)
681 (throw 'popup-done new-event)) 685 (throw 'popup-done new-event))
682 ((not (popup-up-p)) 686 ((button-release-event-p new-event);; don't beep twice
687 nil)
688 ;; It shows how bogus this function is that the event
689 ;; arg could be missing and no-one noticed ...
690 ((event-matches-key-specifier-p new-event (quit-char))
691 (signal 'quit nil))
692 ;; mswindows has no pop-down processing (selection is
693 ;; atomic) so doing anything more makes no sense. Since
694 ;; popup-up-p is always false under mswindows, this
695 ;; function has been ordered to do essentially X-specifc
696 ;; processing after this check.
697 ((not (popup-up-p))
683 (setq unread-command-events (cons new-event 698 (setq unread-command-events (cons new-event
684 unread-command-events)) 699 unread-command-events))
685 (throw 'popup-done nil)) 700 (throw 'popup-done nil))
686 ((button-release-event-p new-event);; don't beep twice 701 ;; mswindows never gets here
687 nil)
688 ((event-matches-key-specifier-p (quit-char))
689 (signal 'quit nil))
690 (t 702 (t
691 (beep) 703 (beep)
692 (message "please make a choice from the menu."))))))) 704 (message "please make a choice from the menu.")))))))
693 705
694 (defun popup-menu-and-execute-in-window (menu-desc event) 706 (defun popup-menu-and-execute-in-window (menu-desc event)