CLIM mail archive

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

:menu-level in CLIM 1.0?



    Date: Fri, 5 Jul 1991 19:21-0400
    From: Peter Clitherow <pc@ctt.ctt.bellcore.com>

    this is probably a trivial question, but in symbolics dynamic windows
    one can separate commands in different command panes.  (:menu-level
    option to a :panes spec).

    reading the (symbolics) CLIM 1.0 documentation i can't see a way to
    associate a command table with a distinct pane.  (when i define a
    command for an application with say two :command-menus, the command
    appears in both).

You put :COMMAND-TABLE <name> in the pane description.  The commands, of
course, have to be in separate command tables.  You currently can't do this
with the automatically-written command definer, unfortunately; you will have to
use DEFINE-COMMAND directly.

    PS, also i note that when i do:

    (define-application-command (com-change-options :menu "Options" :keystroke #\o) 
	    ()
      (dummy)
      )

    the menu prompt that results is "Options (o)" indicating that there's a
    keystroke associated with this.  i would have liked it to use the :menu
    string i supplied directly.  any way of overriding this?

Not currently, in CLIM 1.0.  Here is the function which does the output; you
could change it to test a variable before actually performing the deed:

CLIM::
;; This should never be called with acceptably T
(define-presentation-method present
			    (element (type command-menu-element) stream (view textual-view)
			     &key acceptably)
  (when acceptably
    (error "We don't know how to print command-menu elements acceptably."))
  (let* ((menu (pop element))
	 (keystroke (pop element))
	 (item (pop element))
	 (type (command-menu-item-type item))
	 (command (and (or (eql type ':command)
			   (eql type ':function))
		       (extract-command-menu-item-value item t))))
    (flet ((body (stream)
	     (if keystroke
		 (format stream "~A (~C)" menu keystroke)
	         (format stream "~A" menu))
	     (when (eql type ':menu)
	       (write-string " >" stream))))
      (declare (dynamic-extent #'body))
      (if (and command
	       (not (command-enabled-p (command-name command) *application-frame*)))
	  (with-text-style ('(nil :italic :smaller) stream) (body stream))
	  (body stream)))))

0,,

References:

Main Index | Thread Index