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

more on mouse to command presentation



    Date: Thu, 12 Jul 90 01:19:41 EDT
    From: barmar@think.com

       Date: Wed, 11 Jul 90 17:24:52 MDT
       From: drstrip@cs.sandia.gov (David R Strip [1411])

       What I would like is something like
       (dw:with-output-as-presentation (:object 'form :type 'sys:form)
	   (print "Pretty Name of Form"))

       and have the mouse action on Pretty ... cause the form to eval.

    I haven't tried it (I'm at home right now), but I think you should put the
    :ALLOW-SENSITIVE-INFERIORS NIL option in, or use a different output
    function from PRINT (e.g. WRITE-STRING).  The problem is that PRINT also
    outputs a presentation, which overlaps the presentation produced by
    DW:WITH-OUTPUT-AS-PRESENTATION.  When the cursor is over these
    presentations the one that PRINT produced is chosen.
I'm at work, and can verify that Barry is correct both as to the problem
and as to both solutions he suggests.

As a matter of practice, I recommend the use of WRITE-STRING instead
of PRINT.  It doesn't seem reasonable that the object "Pretty Name of Form"
(the string) should be involved in the presentation at all, since its
only purpose is to indicate the intended display; the string as lisp object
has no semantics here.  Also, PRINT includes doing a newline, which you
probably did not want to include as part of the display of the presentation.
(If you wanted it, you probably wanted it *between* presentations).