CLIM mail archive


Re: dw:find-program-window

  Date: Tue, 24 Nov 1992 14:30+0200
  From: Vincent Keunen <nrb!>
  Is there an equivalent of dw:find-program-window in clim?  If not,
  what's the best way to do that?  A method (before? after? around?) on

This is what I use.  In clim 1, I have to keep a list of all the
root windows that I've opened, *sheet-roots*.  In addition, I
keep a list of all the frames that have "finished", *deactivated-frames*.

In clim 2, clim does all the necessary bookkeeping, as you can see.

(In the development version of clim 2, they've added an even
easier way to map over frames, called something like
(defmacro for-each-frame ((symbol) &body body)
  "Iteratively bind SYMBOL to all enabled frames."
    `(dolist (root *sheet-roots*)
       (dolist (child (slot-value root 'clim::children))
	 (let ((,symbol (clim::window-stream-to-frame child)))
	   (when (and ,symbol (not (member ,symbol *deactivated-frames*))) 
      #'(lambda (port)
	  (dolist (,symbol (clim:frame-manager-frames
			    (clim:find-frame-manager :port port)))
	    (when (eq (clim:frame-state ,symbol) :enabled)

(defun find-program-window (name &key
				 (create-p nil))
      (for-each-frame (f)
		      (when (typep f name)
			(return-from find-program-window f)))
      (when create-p
        (let ((frame (make-application-frame name)))
          (run-frame-top-level frame))))


Main Index | Thread Index