CLIM mail archive

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

Presentation menu questions.



    Date: Thu, 16 Sep 1993 15:50 EDT
    From: Gregory M Anderson <gma@BITTERROOT.apl.washington.edu>

	Date: Wed, 15 Sep 1993 10:29 PDT
	From: Scott McKay <SWM@STONY-BROOK.SCRC.Symbolics.COM>

	    Date: Wed, 15 Sep 1993 11:41 EDT
	    From: Gregory M Anderson <gma@bitterroot.apl.washington.edu>

	    I'm having two problems with the printed output of items displayed 
	    in the :menu mouse gesture menu.

	    1) When I define a translator that passes multiple objects, i.e.

	      (define-presentation-to-command-translator foo-tran
		  (my-type foo my-frame)
		(object frame)
		`(,object ,frame))

	      (define-sectors-frame-command (foo
		    :menu "Print this in the menu.")
		  ((object 'my-type) (frame 'my-frame))
	       (do-something))

	Could you make a small failing application for me?  The apps I have all
	do exactly what I expect.

	      The menu comes up with an corresponding printed representation
	       "Print this in the menu #<PACKAGE::FRAME 123456789>"

	      CLIM seems to want to display a printed representation of the 
	      arguments.  I want to suppress it.

Oh, duh.  After seeing your code, I see that I didn't read your bug
report carefully enough to duplicate what you are doing.

Here's what is going on.  :NAME in the DEFINE-TEST-FRAME-COMMAND's
give FOO-ACTION a command line name of "Foo action for 2 args", and
FOO-ACTION2 a command line name of "Foo action for no args".  The
:POINTER-DOCUMENTATION options give pointer documentation of "Foo with
2 args" and "Foo with no args", but note that pointer documentation
**isn't the same thing** as the ordinary :DOUMENTATION.
:POINTER-DOCUMENTATION is used only for the pointer doc line, and
everything else uses :DOCUMENTATION.  In this case, the menu that gets
popped up uses the default documentation since you didn't provide it,
the default documentation being the "unparsed" command object.

So, just supply the indicated code below.  Then you can even get rid of
:POINTER-DOCUMENTATION.

    vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    SAMPLE CODE 

    Note: these two examples are slightly different, and in seperate packages.

    ;;; -*- Mode: LISP; Syntax: Common-lisp; Package: (menu-test2 :use (clim clim-lisp)) ; Base: 10 -*-
    ;;; Genera 8.3 CLIM 2.0

[Irrelevant code removed]

    (define-test-frame-command (foo-action
				 :name "Foo action for 2 args")
	((object 'foo) (frame 'test-frame)))

    (define-presentation-to-command-translator foo-tran
	(foo foo-action test-frame
-->      :documentation "Foo with 2 args"
	 :pointer-documentation "Foo with 2 args")
	(object frame)
      `(,object ,frame))

    (define-test-frame-command (foo-action2
				 :name "Foo action for no args")
	()
      )

    (define-presentation-to-command-translator foo-tran2
	(foo foo-action2 test-frame
-->	 :documentation "Foo with no args"
	 :pointer-documentation "Foo with no args"
	 :gesture :describe)
	(object)
	())


    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	


	    2) In some cases I want to delete the :menu mouse action altogether,
	       but defining a
		    (define-presentation-to-command-translator foo
			(my-type command frame :menu nil)
	       seems to be determined to add the :menu gesture to the mouse, although
	       it does remove the item from the menu.  So what I end up with is a
	       :menu gesture documented in the mouse line, and an empty menu.
	       Probably confusing to the end user, wouldn't you think?

	In the CLIM I am running, I don't get the menu translator offered unless
	there is something in the menu.

    I don't get the menu, but I do get mouse line documentation on the gesture.

I get this behavior, too.  It's not nearly important enough to fix
right now, but I'll save it for a rainy day.

    vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    SAMPLE CODE 

    Note: these two examples are slightly different, and in seperate packages.

    ;;; -*- Mode: LISP; Syntax: Common-lisp; Package: (menu-test :use (clim clim-lisp)) ; Base: 10 -*-
    ;;; Genera 8.3 CLIM 2.0

[Irrelevant code removed]

    (define-presentation-to-command-translator foo-tran
	(foo foo-action test-frame
	     :pointer-documentation "Foo test"
    ;;;;;;;;;;;;;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	     :menu nil				;THIS DELETES THE ITEM FROM THE MENU
						    ;BUT MENU STILL APPEARS IN THE MOUSE
						    ;LINE DOCUMENTATION
    ;;;;;;;;;;;;;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	     )
	(object frame)
      `(,object ,frame))


    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	

References:

Main Index | Thread Index