Hi,
it seems to me appropriate to map a list of hierarchically grouped displayed line objects onto output records (using the same hierarchy). Those lines have to be sensitive to mouse gestures so I'd like to implement them as presentations.
In my understanding this means I have to create and maintain the output-records manually in the code rather than leaving that up to mcclim, which seems to always append to the end of the output history.
Is there a simple canonicle way to create an instance of a presentation and insert it as a child of a certain output record?
I can find how to add an output record at a certain point, but the present method seems to work on a stream rather than a specific output record.
-- Orm
Hello,
Orm Finnendahl writes:
it seems to me appropriate to map a list of hierarchically grouped displayed line objects onto output records (using the same hierarchy). Those lines have to be sensitive to mouse gestures so I'd like to implement them as presentations.
If I understand you correctly, you don't want each line to be highlighted, but just the group. In that case, wrap with-output-as-presentation around the drawing of the lines. Then you can choose whatever type you want for the presentation, and you can customize the highlighting.
In my understanding this means I have to create and maintain the output-records manually in the code rather than leaving that up to mcclim, which seems to always append to the end of the output history.
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.
Does this solve your problem?
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
Hello,
Orm Finnendahl writes:
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).
Hmm, yes I see. The simplest solution to your problem is probably to use the simple form of incremental output, i.e., your code looks like it presents the entire view after each interaction, except that you have inserted updating-output nodes in strategic places so that the system will not modify output where it is not needed. This method allows you to present the view differently according to the focus, while still getting the advantage of not *really* presenting the entire thing each time.
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.
You don't attach presentations to output records. A presentation *is* an output record (a subclass of it).
Take care,