Lisp HUG Maillist Archive

Differing behavior w/ delivered app

LWM 6.1.1 w/ OS X Maverick..

I have a CAPI application that in the REPL works just fine. The main 
sticking point is that when the application is quit (via menu 
accelerator) it calls quit-interface. According to the documentation, 
this should call the destroy callback for the interface if one is set up.

In The REPL this callback is called, which allows me to write out some 
data to a file that has been modified while the application is running. 
In the delivered application, it would seem that the callback is called, 
because the file is "written" to, except that the file is completely 
wiped instead of being updated.

Does quit-interface not actually wait for the destroy callback to 
complete before nuking the process? Or perhaps there's a better place 
for me to put this code other than the destroy callback?

Thanks!

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Differing behavior w/ delivered app

Jeffrey Massung wrote on Mon, 04 Nov 2013 00:04:29 -0600 10:04:

| LWM 6.1.1 w/ OS X Maverick..
| ...snip...|
| Or perhaps there's a better place
| for me to put this code other than the destroy callback?

On Windows, I use the following destroy-callback for the main application window:

(defmethod interface-on-destroy progn ((face my-iface))
  (with-slots (grid) my-iface
    (when (loaded grid)
      (grid:save-preferences grid)
      (grid:grid-on-destroy grid)))
  (when (yl:delivery-level)
    (lw:quit)))

Here yl:delivery-level returns NIL when in REPL, e.g. in the LispWork IDE.

I also specify the following key argument to the deliver function:
  :quit-when-no-windows nil
--
Sincerely,
Dmitry Ivanov
lisp.ystok.ru

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Differing behavior w/ delivered app


* Jeffrey Massung <527738ED.9000008@gmail.com> :
Wrote on Mon, 04 Nov 2013 00:04:29 -0600:

| I have a CAPI application that in the REPL works just fine. The main
| sticking point is that when the application is quit (via menu
| accelerator) it calls quit-interface. According to the documentation,
| this should call the destroy callback for the interface if one is set
| up.
|
| In The REPL this callback is called, which allows me to write out some
| data to a file that has been modified while the application is
| running. In the delivered application, it would seem that the callback
| is called, because the file is "written" to, except that the file is
| completely wiped instead of being updated.

What were the arguments to CL:OPEN?  --- can you show your
WITH-OPEN-FILE form?

[I've seen some behaviour that I didn't quite understand, from glibc/OS
  filesystem semantics, where the file is removed on error, or (as you
  are seeing) is truncated even when i expected a partial file to be
  written]

| Does quit-interface not actually wait for the destroy callback to
| complete before nuking the process? Or perhaps there's a better place
| for me to put this code other than the destroy callback?

(This may be obvious, but I imagine you can always call the code
explicitly from the menu callback before calling QUIT-INTERFACE)

--Madhu

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:34 UTC