Harlequin Lispworks Windows how-to question 
Author Message
 Harlequin Lispworks Windows how-to question

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?



Wed, 11 Jul 2001 03:00:00 GMT  
 Harlequin Lispworks Windows how-to question
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.

Quote:

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

Quote:
> 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



Thu, 12 Jul 2001 03:00:00 GMT  
 Harlequin Lispworks Windows how-to question
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

Quote:

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



Fri, 13 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. achieving XOR effect with graphics in Harlequin Lispworks for Windows

2. copying text to Windows clipboard from Harlequin Lispworks?

3. Harlequin LispWorks and CORBA

4. Harlequin LispWorks 4.0

5. Info about LispWorks by Harlequin Lisp..

6. Harlequin's LispWorks

7. Harlequin's LispWorks

8. LispWorks for Windows question

9. HARLEQUIN RELEASES ITS HARLEQUIN COMMON LISP ORB

10. function to read cursor (mouse) position in Harlequin Lispworks for Windows?

11. getting UncommonSQL working in LispWorks on windows

12. Lispworks/Windows creating a DLL

 

 
Powered by phpBB® Forum Software