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

I want both keyboard-accelerated and conventional commands in program framework



The documentation for DEFINE-PROGRAM-FRAMEWORK states (volume 7-A revised, page
97) that if :KBD-ACCELERATOR-P is T, to enter an unaccelerated command the user
must first type colon or m-X. I don't get this behavior. Consider the following
example program:

(dw:define-program-framework test-frame
  :command-definer t
  :command-table (:inherit-from '("user") :kbd-accelerator-p t)
  :panes ((menu-window :command-menu)
	  (interactor-window :interactor))
  :terminal-io-pane interactor-window
  :configurations
    '((main
	(:layout
	  (main :column menu-window interactor-window))
	(:sizes
	  (main (menu-window :ask-window self :size-for-pane menu-window)
		:then
		(interactor-window :even)))))
    :select-key #\a)

(define-test-frame-command (com-print-hello
			     :name "Print Hello"
			     :menu-accelerator "Print Hello"
			     :keyboard-accelerator #\c-h)
			   ()
  (print "Hello"))

(define-test-frame-command (com-print-goodbye
			     :name "Print Goodbye"
			     :menu-accelerator "Print Goodbye"
			     :keyboard-accelerator #\c-g)
			   ()
  (print "Goodbye"))

(define-test-frame-command (com-print-stop
                             :name "Print Stop")
                           ()
  (print "Stop"))

My commands are acessible by the keyboard acclerators #\c-h and #\c-g, and by
the menu items, but I am not able to enter a colon or m-X in order to execute
the command COM-PRINT-STOP, which is accessible neither from the menu or a
command accelerator. I have tried various options to :TOP-LEVEL with no success.

Also, is there any way to have keyboard accelerators with a top-level that
understands both commands and Lisp forms? It seems I read somewhere that it's
not possible, but I can't find it now.