From: Martin Raspaud
Subject: mcclim interactor pane
Date: 
Message-ID: <cceb24$n5j$1@news.u-bordeaux.fr>
Hi all,

here is another (mc)clim question :

In my following code, I don't get why nothing shows up when I type in 
the interactor... I tried to make my own interactor to make it a simple 
lisp listener, but it seems something is wrong...

Any idea?

the code :

(in-package :clim-user)

(defun init (frame)
   (setf (kwak-interactor frame) (find-pane-named frame 'interactor)))

(define-command com-exit ()
   (throw (kwak-exit-exception *application-frame*) nil))

(defmethod kwak-top-level ((kwak-frame application-frame) &rest rest 
&key (prompt "kwak> "))
   (declare (ignore rest))
   (when climi::*multiprocessing-p*
     (sleep 2))
   (catch (kwak-exit-exception kwak-frame)
     (loop
      (let* ((interactor (find-pane-named kwak-frame 'interactor))
	    (*standard-input* interactor)
	    results)
        (stream-write-string *standard-input* prompt)
        (stream-finish-output *standard-input*)
        (setq results ; eval interactor's content
	     (multiple-value-list (eval
				   (read-from-string
				    (stream-read-line *standard-input*)))))
        (loop for result in results
	     do (print result *standard-input*))
        (terpri *standard-input*))))
   (destroy-mirror (climi::port kwak-frame)
		  (frame-top-level-sheet kwak-frame)))

(define-application-frame kwak-frame ()
   ((exit-exception :initform (intern (concatenate 'string (symbol-name 
(gensym)) "-exit"))
		   :reader kwak-exit-exception)
    (interactor :initform nil :accessor kwak-interactor))
   (:panes
    (board :application
	   ;;:display-function nil
	   ;;:display-time nil
	   :height 200
	   :min-width 600
	   :min-height 300)
    (interactor :interactor
                :height 60
                :min-width 600
                :min-height 80))
   (:layouts
    (default (vertically ()
	      board
	      interactor)))
   (:top-level (kwak-top-level)))

(setf my-frame   (make-application-frame 'kwak-frame))
(init my-frame)
(run-frame-top-level my-frame)


Thanx

Martin