CLIM mail archive


Panes that are not in the current layout have no medium?

CLIM 2.0-beta on LispWorks 3.2.21-beta-4
CLIM 2.0 on Allegro 4.2

Apparently, in CLIM 2.0 (unlike in CLIM 1.1) a pane that is not listed
in the frame's current pane layout has no medium.  Hence, one cannot
draw any output on such a pane (or into its output history), even with
the :DRAW output recording option set to NIL.  This seems a bit
constraining.  It means that I cannot keep any hidden panes up to date
via output recording.  Instead, whenever I write to such a pane I have
to enclose it in a

(when (clim:sheet-medium hidable-pane-stream) ...)

and I must in some other way keep track of everything I want recorded
on that pane.  Is this correct?

An example is attached.  Invoke the Switch Layout command, then
attempt to execute the Write Something command.

        Lawrence G. Mayka
        AT&T Bell Laboratories

Standard disclaimer.

(in-package :cl-user)

(defpackage dead-pane (:use))

(clim:define-application-frame dead-pane ()
   (application-a :application
                  :label "Application A"
                  :width 700
                  :height 150)
   (application-b :application
                  :label "Application B"
                  :width 700
                  :height 150)
   (interactor :interactor
	       :label "Interactor"
	       :width 700
	       :height 150))
   (layout-a (clim:vertically ()
   (layout-b (clim:vertically ()

(define-dead-pane-command (dead-pane::quit :name t :menu t) ()
   (clim:frame-exit clim:*application-frame*))

(define-dead-pane-command (dead-pane::switch-layout :name t :menu t) ()
   (let* ((frame clim:*application-frame*)
          (old-layout (clim:frame-current-layout frame))
          (new-layout (if (eql old-layout 'layout-a) 'layout-b 'layout-a)))
     (setf (clim:frame-current-layout frame) new-layout)))

(define-dead-pane-command (dead-pane::write-something :name t :menu t) ()
   (let* ((frame clim:*application-frame*)
          (appl-a-stream (clim:get-frame-pane frame 'application-a))
          (appl-b-stream (clim:get-frame-pane frame 'application-b)))
     (format appl-a-stream "This is Application A.~%")
     (clim:with-output-recording-options (appl-b-stream
                                          :draw (clim:sheet-medium appl-b-stream))
       (format appl-b-stream "This is Application B.~%"))))


Main Index | Thread Index