[mcclim-devel] presentations as childs of specific output records

Orm Finnendahl o.finnendahl at inm.mh-freiburg.de
Fri Dec 10 11:04:56 UTC 2010


Hello Robert,

Am Friday, den 10. December 2010 um 06:44:04 Uhr (+0100) schrieb Robert Strandh:
> 
> If I understand you correctly, you don't want each line to be
> highlighted, but just the group.

that depends on the current focus. The main point in the application
is to be able to change the focus from one single line to the group it
is contained in (and to the group the groups are contained in and so
forth). Those changes of focus are quite frequent and I try to avoid
having to replay the whole drawing on focus change (that's why I try
to maintain the output records and it's hierarchy directly).

> It appends to the end of the current output record, but that is fact
> is important only to the display order.  The records are conceptually
> drawn from bottom to top according to this order. But you can create
> hierarchies of output records and presentations by opening a new
> output records.  One way of doing that is to use
> with-output-as-presentation.

I think it would solve my problem, but I haven't figured out, how to
accomplish that in code. I know how to instantiate output records and
insert them into the tree (using add-output-record), but I don't know
how to attach presentations to them. 

Here is what I tried: I used with-output-as-presentation, giving it
the (undocumented) :parent keyword, hoping it would add the
presentation as a child of the given output record, but that gave an
error:

(defmethod display-quolines ((frame clim-quo) stream)
  (dolist (quoline *quolines*)
    (with-output-as-presentation
        (stream
         quoline
         'quoline
         :parent (stream-current-output-record stream)))))

The error:

#<STANDARD-PRESENTATION 0.0d0:0.0d0,0.0d0:0.0d0 QUOLINE {1003FBBEA1}>
   already has a parent #<STANDARD-TREE-OUTPUT-HISTORY X 0.0d0:0.0d0 Y
   0.0d0:0.0d0 {1003C88741}>.  [Condition of type SIMPLE-ERROR]

It would be great if someone could push me in the right direction.

--
Orm




More information about the mcclim-devel mailing list