From: Sam S. <sd...@gn...> - 2004-08-30 20:48:29
|
> * Jeff Andrews <wrsserl@dhnpxrewnpx.pbz> [2004-08-30 15:45:20 -0400]: > > http://www.cliki.net/CLX there is no code for MENU-CHOOSE on this page. > and the manual it links to is: > http://www.stud.uni-karlsruhe.de/~unk6/clxman/ there is no code for MENU-CHOOSE on this page either. > (defun menu-choose (menu x y) > ;; Display the menu so that first item is at x,y. > (menu-present menu x y) > > (let ((items (menu-item-alist menu)) > (mw (menu-window menu)) > selected-item) > > ;; Event processing loop > (do () (selected-item) > (EVENT-CASE ((DRAWABLE-DISPLAY mw) :force-output-p t) > (:exposure > (count) > ;; Discard all but final :exposure then display the menu > (when (zerop count) (menu-refresh menu)) > t) > > (:button-release > (event-window) > ;;Select an item > (setf selected-item (second (assoc event-window items))) > t) > > (:enter-notify > (window) > ;;Highlight an item > (menu-highlight-item menu (find window items :key #'first)) > t) > > (:leave-notify > (window kind) > (if (eql mw window) > ;; Quit if pointer moved out of main menu window > (setf selected-item (when (eq kind :ancestor) :none)) > ;; Otherwise, unhighlight the item window left > (menu-unhighlight-item menu (find window items :key #'first))) > t) > > (otherwise > () > ;;Ignore and discard any other event > t))) > > ;; Erase the menu > (UNMAP-WINDOW mw) > > ;; Return selected item string, if any > (unless (eq selected-item :none) selected-item))) you need to (use-package "XLIB") before evaluating this code. -- Sam Steingold (http://www.podval.org/~sds) running w2k <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.honestreporting.com> In C you can make mistakes, while in C++ you can also inherit them! |