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

Question about Presentations

I am trying to "present" an object to a screen with a label different
from the usual printed representation of the object. When I mouse-select
the label during an "accept" call, I want to have accept return the
presented object.

I tried the following simple function:

(defun present-as (object label &key (stream *standard-output*))
  "Presents object to stream with given label"
  (dw:with-output-as-presentation (:single-box t
				   :type (type-of object)
				   :stream stream
				   :object object)
    (format stream "~a" label)))

When I present a structure instance, typing (accept 'sys:expression) and 
clicking on the screen representation returns the original instance.

However, when I present an instance of flavor "frame" (a flavor I define
in my code), I get the following curious behaviour:

(1) using (accept 'frame) and clicking returns the original instance
(2) using (accept 'sys:expression) and clicking returns the label!

I want to use (accept 'sys:expression) because I have several different
kinds of presented objects that I want all to be mouse-selectable.

I imagine this is a failure in my understanding of presentations rather
than a bug. Could someone suggest how I can achieve the behaviour I desire?

	Thanks very much,

		Mark Klein
		Hitachi Ltd.
		Advanced Research Lab
		Hatoyama, Saitama 350

		Phone: 0492-96-6111 ext. 341
		Fax:   0492-96-6006 


Please double-check the "To:" field of your reply if you use
the e-mail "reply" command; occasionally the wrong address 
will be entered due to incompatability between US and Japanese 
e-mail software.