[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.


                             (title "Handey Window")
                             (size (list hu::*default-actual-window-width*
                             (position '(6 44)))
  (let* ((mac-window (ccl:oneof (if hu::*color-handey*
                            :window-type :tool
                            :window-size (ccl:make-point (first 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*) 
             (hlisp:clear-window *OTHER-GRAPHICS-WINDOW*)
             (setq *other-graphics-window* nil))
                  (eq (handey-window-mac-window *RECOGNITION-GRAPHICS-WINDOW*) 
             (hlisp:clear-window *RECOGNITION-GRAPHICS-WINDOW*)
             (setq *recognition-graphics-window* nil))
                  (eq (handey-window-mac-window
             (hlisp:clear-window *PATH-PLANNING-GRAPHICS-WINDOW*)
             (setq *path-planning-graphics-window* nil))
                  (eq (handey-window-mac-window
              (hlisp:clear-window *GRASP-PLANNING-GRAPHICS-WINDOW*)
             (setq *grasp-planning-graphics-window* nil)))
... [extraneous code omitted] ...