[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suicidal windows
- To: info-mcl@digitool.com
- Subject: Re: Suicidal windows
- From: pch@mystech.com (Pete Halverson)
- Date: Mon, 24 Apr 1995 08:09:43 -0400
- Organization: Mystech Associates
- References: <9504240041.aa14856@post.demon.co.uk>
- Sender: owner-info-mcl@digitool.com
In article <9504240041.aa14856@post.demon.co.uk>, dim@lissys.demon.co.uk
(Dimitri Simos) wrote:
> I'm trying to create a class of window that has a rather
> temporary existence: It must die if the user clicks on it
> or if it gets covered by any other window, thus becoming
> something other than the frontmost window.
>
> The second one baffles me. OK, I have tried the 'obvious' one that
> doesn't work, and yes, it sends MCL into an infinite recursion:
>
> (defclass tempo-window (window) ())
>
> (defmethod view-deactivate-event-handler :around
> ((w tempo-window))
> (call-next-method)
> (window-close w))
>
>
> Any ideas on how to do this properly would be appreciated.
I usually use an idiom like the following for situations like yours:
(defvar *suppress-recursive-closures* nil)
(defmethod view-deactivate-event-handler :around ((w tempo-window))
(unless *suppress-recursive-closures*
(let ((*suppress-recursive-closures* t))
(call-next-method))
(window-close w))))
pch