[mcclim-devel] Application pane vertical scrolling does not work with table formatting
I have found an annoying problem that severely limits the use of table formatting in application panes. This sample code shows the problem: (in-package :clim-user) (define-application-frame no-scroll () () (:pointer-documentation t) (:panes (app :application :display-time :command-loop :display-function 'display-function :end-of-line-action :wrap :end-of-page-action :scroll :scroll-bars t)) (:layouts (default app))) (defun display-function (frame stream) (declare (ignore frame)) (formatting-table (stream) (dotimes (i 100) (formatting-row (stream) (formatting-cell (stream) (princ i)))))) (define-no-scroll-command (com-quit :menu t) () (frame-exit *application-frame*)) Run it with: (run-frame-top-level (make-application-frame 'no-scroll)) Although the tabular output is longer than the application pane's viewport, it is not possible to vertically scroll it to see the remaining part. The thumb occupies all the scroll bar's area, as if there was no additional output. Is the above code supposed to work? Am I doing anything wrong? Any workarounds? Paolo -- Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
This is similar to the problem you reported earlier involving graph formatting in the listener. The problem is that the space requirements of the application-pane are not updated to be large enough to contain your output. After generating your output, this can be done manually as follows: (change-space-requirements pane :width (bounding-rectangle-width (stream-output-history pane)) :height (bounding-rectangle-height (stream-output-history pane)))) Having just looked through the spec, I'm thinking this is a bug rather than a feature (which I was not certain of previously). I'll take another look at fixing this in my next batch of changes. On Tue, 28 Dec 2004 18:40:02 +0100, Paolo Amoroso <amoroso@mclink.it> wrote:
I have found an annoying problem that severely limits the use of table formatting in application panes. This sample code shows the problem:
Andy Hefner <ahefner@gmail.com> writes:
The problem is that the space requirements of the application-pane are not updated to be large enough to contain your output. After generating your output, this can be done manually as follows:
(change-space-requirements pane :width (bounding-rectangle-width (stream-output-history pane)) :height (bounding-rectangle-height (stream-output-history pane))))
This workaround works magnificently. Thanks a quadrillion. Paolo -- Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
"PA" == Paolo Amoroso <amoroso@mclink.it> writes:
PA> Andy Hefner <ahefner@gmail.com> writes: >> The problem is that the space requirements of the application-pane are >> not updated to be large enough to contain your output. After >> generating your output, this can be done manually as follows: >> >> (change-space-requirements pane >> :width (bounding-rectangle-width >> (stream-output-history pane)) >> :height (bounding-rectangle-height >> (stream-output-history pane)))) PA> This workaround works magnificently. Thanks a quadrillion. That's the workaround, but is this still a bug? Surely the space requirements should be automagically updated by formatting-table? I can find the place in the code where the size of the output record is updated, but am too ignorant of the McCLIM internals to propose where the update should be made.... Or, is this not a bug, and is this kind of dimension update the responsibility of anyone who provides a display method? Best, r
On Dec 28, 2004, at 6:40 PM, Paolo Amoroso wrote:
I have found an annoying problem that severely limits the use of table formatting in application panes. This sample code shows the problem:
...
Although the tabular output is longer than the application pane's viewport, it is not possible to vertically scroll it to see the remaining part. The thumb occupies all the scroll bar's area, as if there was no additional output.
Is the above code supposed to work? Am I doing anything wrong? Any workarounds?
This is probably a bug, or at least could be handled by McCLIM itself. I added this in an application I wrote that displays really big tables: (defclass redisplay-frame-mixin () ()) (defmethod redisplay-frame-pane :after ((frame redisplay-frame-mixin) (pane application-pane) &key force-p) (declare (ignore force-p)) (change-space-requirements pane :height (bounding-rectangle-height (stream-output-history pane)))) (define-application-frame geekbooks (master-frame-mixin redisplay-frame-mixin standard-application-frame) ((current-account :accessor current-account) (reconciling-activity :accessor reconciling-activity)) ...) This could be the default for application panes with scroll bars. Tim
participants (4)
-
Andy Hefner
-
Paolo Amoroso
-
rpgoldman@real-time.com
-
Timothy Moore