[mcclim-devel] How to open a frame opened with OPEN-WINDOW-STREAM

Paolo Amoroso amoroso at mclink.it
Sun Apr 3 14:27:00 UTC 2005


I would like to simulate a modal dialog, contained in its own window,
via an ACCEPTING-VALUES inside a frame opened with
OPEN-WINDOW-STREAM.  I use code like this:

(in-package :clim-user)

(define-application-frame window-stream ()
  ()
  (:menu-bar t)
  (:panes
   (commands :interactor))
  (:layouts
   (default commands)))

(defun show-dialog (stream)
  (let (integer string)
    (restart-case
        (accepting-values (stream)
          (setq integer (accept 'integer :stream stream
                                :prompt "Gimme an integer "))
          (terpri stream)
          (setq string (accept 'string :stream stream
                               :prompt "Gimme a string "))
          (terpri stream))
      (abort () nil))
    (values integer string)))

(define-window-stream-command (com-dialog :menu t :name t)
    ()
  (let ((stream (open-window-stream)))
    (unwind-protect (multiple-value-bind (integer string) (show-dialog stream)
                      (format t "~&You entered ~D and ~A~%" integer string))
      (when (open-stream-p stream)
        (frame-exit (pane-frame stream))
        (close stream)))))

(define-window-stream-command (com-quit :menu t :name t)
    ()
  (frame-exit *application-frame*))

This mostly works, but the CLIM frame opened with OPEN-WINDOW-STREAM
is not closed.  I tried using only CLOSE in COM-DIALOG, but without
success.  How can I close that window?


Paolo
-- 
Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log



More information about the mcclim-devel mailing list