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

Help...I've got window confusion...



Below I've included part of a procedure from some code that's got me
baffled.  Bascially, the procedure create and initializes "handey-windows"
a structure which contains a mac window.  The problem I'm having occurs in
the window-close objfun.  Because handey windows have data associated with
them, the usual window close function which just kills the mac window isn't
sufficient.  Consequently, this window-close function (i.e. the one defined
below) tries to figure out which of the four display windows has had its
close box clicked then clears the contents of the handey-window structure
and resets the variable.  Finally, usual-window-close is called.  Using
(ed-beep), I've convinced myself that the conditional checking is going
down the correct path, but the call to usual-window-close doesn't do
anything unless the window clicked is the one pointed to by
*other-graphics-window* - in which case everything seems to work fine.
I've tried putting the call to usual... inside each arm of the cond, but
that doesn't help.  Also, hlisp:clear-window just resets some handey-window
fields and erase rects the window, so I don't think it is the problem.  I'm
really baffled because the close works fine for *other-graphics-window* but
not for any of the others.  I'd appreciate any ideas.

Thanks,
Steve

(defun CREATE-HANDEY-WINDOW (&key 
                             (title "Handey Window")
                             (size (list hu::*default-actual-window-width*
                                         hu::*default-actual-window-height*))
                             (position '(6 44)))
  (let* ((mac-window (ccl:oneof (if hu::*color-handey*
				    user::*color-window*
				    user::*window*)
                            :window-type :tool
                            :window-size (ccl:make-point (first size)
							 (second
							  size))
                            :window-position (ccl:make-point
					      (first position)
					      (second position))
                            :window-title title))
         (handey-window (hu::make-handey-window 
                         :MAC-window  mac-window)))
    (ccl:defobfun (ccl::window-close mac-window) ()
      (cond ((and *other-graphics-window*
                  (eq (handey-window-mac-window *OTHER-GRAPHICS-WINDOW*) 
                      (ccl:self)))
             (hlisp:clear-window *OTHER-GRAPHICS-WINDOW*)
             (setq *other-graphics-window* nil))
            ((and *RECOGNITION-GRAPHICS-WINDOW*
                  (eq (handey-window-mac-window *RECOGNITION-GRAPHICS-WINDOW*) 
                      (ccl:self)))
             (hlisp:clear-window *RECOGNITION-GRAPHICS-WINDOW*)
             (setq *recognition-graphics-window* nil))
            ((and *PATH-PLANNING-GRAPHICS-WINDOW*
                  (eq (handey-window-mac-window
		       *PATH-PLANNING-GRAPHICS-WINDOW*) 
                      (ccl:self)))
             (hlisp:clear-window *PATH-PLANNING-GRAPHICS-WINDOW*)
             (setq *path-planning-graphics-window* nil))
            ((and *GRASP-PLANNING-GRAPHICS-WINDOW*
                  (eq (handey-window-mac-window
		       *GRASP-PLANNING-GRAPHICS-WINDOW*) 
                      (ccl:self)))
              (hlisp:clear-window *GRASP-PLANNING-GRAPHICS-WINDOW*)
             (setq *grasp-planning-graphics-window* nil)))
      (ccl::usual-window-close))
... [extraneous code omitted] ...