From: ·················@mindless.com
Subject: Harlequin Lispworks Windows how-to question
Date: 
Message-ID: <36aa1bf6.4601486@news.telia.no>
I'm trying to programmatically close windows that I've created by
calling capi:display on interfaces.  The doc (capi reference) gives an
example of doing this, using the capi:destroy method, but when I try
it out (keying in the example verbatim) in both lww 4.0.1 and lww  4.1
personal, the window does not close and the destroy-callback function
is not called.  I don't get an error message though, the call simply
returns nil or sometimes T (I haven't been able to tell what the
difference between the two situations is).

I've tried to call destroy on both the value returned by the
(make-instance 'interface) call and the value returned by calling
display on such an instance.  Neither closes the window.  (typep x
'interface) returns T for both.

Have I missed something obvious?

From: Robert Monfera
Subject: Re: Harlequin Lispworks Windows how-to question
Date: 
Message-ID: <36ABA7C7.7F06A970@fisec.com>
Hi Kristoffer,

It happened to me as well, and I also do not know why (I have had more
burning problems than this, so I have not called support with this
issue).
However, it works as documented in a delivered (EXE) application for me.

·················@mindless.com wrote:
> 
> I'm trying to programmatically close windows that I've created by
> calling capi:display on interfaces.  The doc (capi reference) gives an
> example of doing this, using the capi:destroy method, but when I try
> it out (keying in the example verbatim) in both lww 4.0.1 and lww  4.1
> personal, the window does not close and the destroy-callback function
> is not called.  I don't get an error message though, the call simply
> returns nil or sometimes T (I haven't been able to tell what the
> difference between the two situations is).

If it is not in the documentation, you do not have to worry about it
because it means that Harlequin do not think it is valuable for you.  By
the way, I find the LWW 4.0.1 and 4.1 documentation very brief, so I
often spend enormous time trying to figure out how things work, or have
to call support (even for things like delivery of application that is
not crashing).
 
> I've tried to call destroy on both the value returned by the
> (make-instance 'interface) call and the value returned by calling
> display on such an instance.  Neither closes the window.  (typep x
> 'interface) returns T for both.
> 
> Have I missed something obvious?

Maybe both of us did, but if several people miss it, it may not be
obvious (i.e. it could be a bug or missing underdocumentation).

Robert
From: Nick Levine
Subject: Re: Harlequin Lispworks Windows how-to question
Date: 
Message-ID: <36AC816C.3FD36E99@harlequin.co.uk>
This is a multithreading problem.  By default, CAPI:DISPLAY creates a new
light-weight process for the interface using MP:PROCESS-RUN-FUNCTION and,
in MS Windows, calls to CAPI:DESTROY must be in the same process as the
window itself.

You need to execute the CAPI:DESTROY in the interface's process.  Usually
this happens automatically, for example via a callback from the interface
itself.  In cases where you want to destoy an interface from another
window, use CAPI:EXECUTE-WITH-INTERFACE to call the function in the
process associated with the interface.

eg
  (setq interface (capi:display (make-instance 'capi:interface)))
  (capi:execute-with-interface interface 'capi:destroy interface)
       or
  (capi:execute-with-interface interface
                               #'(lambda () (capi:destroy interface)))

-nick


·················@mindless.com wrote:

> I'm trying to programmatically close windows that I've created by
> calling capi:display on interfaces.  ...