CLIM mail archive

[Prev][Next][Index][Thread]

updating-error




Hello CLIMers,

I found some amazing error (?) with updating-output.
The update of the first pane (vehicle, see listing below)
in my define-application-frame doesn't work correct,
things aren't updated.
If I insert some pane before the 'error'-pane in :panes - without
doing anything with this additional pane, it stays invisible -
the code works!
You can compile the following example, type (init <hostname>)
to get the initial window, then type (show-info-window '(1 2 3 4))
to get the error (not updated pane).

Ralf Nikolai
email: nicolai&fzi.de 

P.S.: My platform is a SYMBOLICS UX1200S with CLIM1.0.

;;; -*- Package: CLIM-USER; Mode: LISP; Syntax: Common-Lisp -*-
(define-application-frame up ()
    (;;ift-Element
     (done-sections :initform '(1 2 3) :accessor done-sections))
  (:panes
    (
;     (why :application				      ;To avoid the
;	  :scroll-bars nil			      ;error
;	  :display-function 'display-why	      ;uncomment
;	  :incremental-redisplay t		      ;these 5
;	  :display-after-commands nil)		      ;lines!
     (vehicle :application
	      :scroll-bars nil
	      :display-function 'display-vehicle-pane
	      :incremental-redisplay t
	      :display-after-commands nil)
     (time :application
	   :scroll-bars nil			  
	   :display-function 'display-why
	   :display-after-commands nil)
     (fix-time :application
	       :scroll-bars nil			  
	       :display-function 'display-why
	       :display-after-commands nil)
     (speed :application
	    :scroll-bars nil			  
	    :display-function 'display-why
	    :display-after-commands nil)
     (done :application
	   :scroll-bars nil			  
	   :display-function 'display-why
	   :incremental-redisplay t
	   :display-after-commands nil)
     (to-do :application
	    :scroll-bars nil			  
	    :display-function 'display-why
	    :incremental-redisplay t
	    :display-after-commands nil)
     (message :application
	      :scroll-bars nil			  
	      :display-function 'display-why
	      :incremental-redisplay t
	      :display-after-commands nil)
     (reaction :application
	       :scroll-bars nil			  
	       :display-function 'display-why
	       :incremental-redisplay t
	       :display-after-commands nil)
     (menu :command-menu)))
  (:layout
    ((main 
       (:column :rest
	(vehicle 1/10)
	(time 1/15)
	(:row :rest
	 (:column :rest
	  (fix-time 1/4)
	  (done 3/8)
	  (message :rest))
	 (:column :rest
	  (speed 1/4)
	  (to-do 3/8)
	  (reaction :rest)))
	(menu :compute))))))

(defvar *up* nil)

(defmethod display-why ((frame up) stream)
  (declare (ignore stream)))

(defmethod display-vehicle-pane ((frame up) stream)
  (with-slots (done-sections) frame
    (updating-output (stream :unique-id ':done-title
			     :cache-value 0
			     :cache-test #'=)
      (format stream "~% Sections: "))
    (let ((i 1)
	  (n-len (floor (/ (window-inside-width stream) (stream-string-width stream "12345 ")))))
      (with-end-of-line-action (:allow stream)
	(dolist (section done-sections)
	  (updating-output (stream :unique-id section
				   :cache-value section
				   :cache-test #'eql)
	    (format stream " ~A" section)
	    (when (= (mod i n-len) 0) (format stream "~%"))
	    (setf i (1+ i))))))))

(define-up-command (com-up-exit :name t :menu "EXIT") ()
  (let ((window (frame-top-level-window *up*)))
    (window-clear window)
    (setf (window-visibility window) nil)
    (window-visibility window)
    (frame-exit *up*)))

(defvar *my-clim-root* nil)

(defun show-info-window (some-list)
  (let ((window (frame-top-level-window *up*)))
    (setf (done-sections *up*) some-list)
    (redisplay-frame-pane *up* 'vehicle)
    (redisplay-frame-pane *up* 'done)
    (redisplay-frame-pane *up* 'to-do)
    (redisplay-frame-pane *up* 'message)
    (redisplay-frame-pane *up* 'reaction)
    (setf (window-visibility window) t)
    (window-visibility window)))

(defun init (&key (host "ossi"))
  (setf *my-clim-root* (clim:open-root-window :clx :host host)
	*up* (clim:make-application-frame 'up :parent *my-clim-root*
					  :left 50 :right 900 :top 0 :bottom 700)
	(output-recording-stream-output-record (get-frame-pane *up* 'time))
	(make-instance 'clim::linear-output-record)
	(output-recording-stream-output-record (get-frame-pane *up* 'fix-time))
	(make-instance 'clim::linear-output-record)
	(output-recording-stream-output-record (get-frame-pane *up* 'speed))
	(make-instance 'clim::linear-output-record))
  (process:process-run-function "up" #'clim:run-frame-top-level *up*))



Main Index | Thread Index