Hi Andy,
After redisplay, McCLIM resizes the pane to fit the bounding rectangle of the output history. If you're redisplaying the pane from scratch, I don't understand why the bounding rectangle shouldn't be tightened - it'd probably a bug. A small test case to demonstrate would be helpful. Also, the behavior here changed recently, and maybe I didn't think thoroughly through what I was doing.
Essentially that is what I'm doing. Here is a small test application to play around with:
http://paste.lisp.org/display/75476
With the latest mcclim cvs snapshot I get the following behaviour:
Press "inc" a couple of times and the "dec" again. If you resize the window accordingly (and maybe press "redisplay") I see that the pane size doesn't decrease beyond the prior maximum. I included the "clear" history button, but now found out, that the history is cleared anyway on complete redisplay (i guess this makes sense, otherwise your history would soon get huge).
Can you reproduce that behaviour? If I understand you correctly it is a bug.
If you clear the output history and (bounding-rectangle (stream-output-history stream)) doesn't shrink afterward, it's definitely a bug.
The thing to do here, I think, is to call change-space-requirements, not resize-sheet. If the parent of your pane is some kind of layout pane, the space will be reallocated top-down based on the space requirements, with the layout pane itself calling resize-sheet on your pane, overriding your change.
As you've probably figured out, adapting recorded output to the pane size is tricky. The status bar in the listener used to do this to justify the memory usage to the right, but occasionally it would find a new way to recursively blow up. I decided it was more trouble than it was worth and ripped it out. Still, you might make it work for your application. It's certainly something we *should* support, but no one has really worked out the best way to do it and carved a safe path through McCLIM to make sure it works.
Oh I haven't even gotten this far. At the moment I'm displaying things from scratch most of the time. This might be an issue later, when I need to optimize for speed. I will report back if I have trouble/success in that direction.
Actually I might need something like that soon. I'm implementing a "timeline" and want a vertical line to follow the cursor, when in the timeline-pane. As I understand it my options are either incremental- redisplay and redisplay that single line only when the cursor moves, or use +flipping-ink+ ink somehow to remove the old line and draw it again at the new position....
Anyways thanks for your answer. It explained a couple of things I didn't fully understand!
Best Regards, Niko Demmel