[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about command menus



    Date: Thu, 1 Nov 90 14:55 PST
    From: maglio%cogsci@ucsd.edu (Paul Maglio)


    Perhaps I'm missing something obvious:  Is there any way to get
    two different command menus in one program framework to share
    menu items?  Like can one command have more than one menu-level?
    Maybe what I want are hierarchical command menus...  

    Any answers, ideas, or comments are greatly appreciated.  

    Thanks.

    -Paul 
Sure, but the documentation (P76, Book 11, dw:define-program-command) is
incorrect, it shows: 

   ....&key ...
   (menu-level '(:top-level))

which (to me anyway) implies a quoted list of menu levels that you want the
command to appear on.  Actually if you use a NON-quoted list, it works fine,
i.e.   :menu-level (:top-level :another-menu)

eric

Here's an example I tested it out with, it seems to work fine.
--------------------------------------------------------------------------------

;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10 -*-
(dw:define-program-framework 1oi
0  :select-key #\o
  :command-definer t
  :command-table
  (:inherit-from '("colon full command" "standard arguments" "input editor compatibility")
   :kbd-accelerator-p 'nil)
  :state-variables (
		    (top-level-task-list)
		    (open-task)
		    (complete-task-list)
		    )
  :panes
  ((status :display)
   (tasks :display)
   (display :display
	    :redisplay-after-commands t
	    :margin-components
	    '((dw:margin-scroll-bar )
	      (dw:margin-scroll-bar :margin :bottom)))
   (listener :listener
	     :typeout-window t
	     :margin-components
	    `((dw:margin-scroll-bar )))
   (menu :command-menu :menu-level :top-level)
   (menu-2 :command-menu :menu-level :menu-2))
  :configurations
  '((dw::main
     (:layout (dw::main :column row-1 row-2) (row-1 :row column-2 display)
      (column-2 :column status tasks) (row-2 :row menu-2 listener menu))
     (:sizes (dw::main (row-1 .8) :then (row-2 :even))
      (row-1 (column-2 .25) :then (display :even))
      (column-2 (status 5 :lines) :then (tasks :even))
      (row-2 (menu :ask-window self :size-for-pane menu)
	     (menu-2 :ask-window self :size-for-pane menu-2)
	     :then (listener :even))))))


(define-oi-command 1(com-0menu-test
		     :menu-accelerator t
		     :menu-level (:top-level2 0:menu-2))
    ()
   (format (dw:get-program-pane 'display) "A test ~%"))