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

Re: Suicidal windows



Thanks to all the folks that replied to this question.

I'm now using the following suggestion by Angus McIntyre (very
similar to that of Pete Halverson):

(defclass tempo-window (window)
  ((closing-p  :initform NIL)))

(defmethod view-deactivate-event-handler :around
           ((W tempo-window))
  (call-next-method)
  (unless (slot-value W 'closing-p)
    (setf (slot-value W 'closing-p) T)
    (window-close W)))

Thanks Angus, this works as required when the window gets covered,
however, if the close box is clicked or the 'close' menu-item is used,
the following error appeared:

> Error: Attempt to nullify an already null view wptr
> While executing: #<standard-method remove-view-from-window :after
>(simple-view)>

So, with a bit of guesswork I've now also added the following:

(defmethod window-close :around
           ((W tempo-window))
  (setf (slot-value W 'closing-p) t)
  (call-next-method))

..and everything now seems OK.

Cheers!



--

Dimitri Simos                                dim@lissys.demon.co.uk
___________________________________________________________________
Lissys Ltd.                 Tel.(Voice & Fax): UK (+44) 1509 235620