Re: Delivered CAPI text input misdirected to stdout

"Lawrence Au (as la at synap dot news)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Hi Matthew,

   Thank you so much for your detailed suggestions! You were right about Terminal becoming first responder for events! I was able to use examples of create-macos-application-bundle from the Lispworks docs and create a S0crates.app with a Lispworks icon. There was trouble running past GateKeeper but when I bypasses GateKeeper in Settings -> Private & Security before trying to open the  S0crates.app, it actually ran fine.  And now I can just double click on it to run it past GateKeeper.

Thankfully,

Lawrence Au

PS. This is the S0crates-build.lisp file that worked:

(in-package "CL-USER")
;; this file was generated by calling put-script-for-capi-delivery at universal-time["zone 5 time 9:20:58 date 2025/9/10"]
;; to build a custom lisp image at cur-image-file-path "~/release/kernel/lisp-images/s0crates.image"
;; load the current LispWorks system code:
(load-all-patches)
(load "~/release/kernel/pg-lisp/Installers/quicklisp.lisp")
(load "/Users/lawrenceau/quicklisp/setup.lisp")
;; load the pg-lisp system code:
(load "~/release/kernel/pg-lisp/pg-lisp.lisp")
(ensure-directories-exist "~/release/kernel/lisp-images/s0crates.image")
(ensure-directories-exist "~/release/kernel/lisp-images/s0crates-build.lisp")
(format t "lisp load script s0crates-build.lisp calling deliver to start function 'test-multi-line-text-input-pane now...
")
(deliver 'test-multi-line-text-input-pane 
  (HCL:CREATE-MACOS-APPLICATION-BUNDLE "~/release/kernel/lisp-images/s0crates.image")
  0 ; minimal reduction of image size results in image about 2 to 3 GB
  :interface :capi
  :multiprocessing t
  :keep-pretty-printer t)



> On Sep 9, 2025, at 12:45 PM, Matthew Sinclair-Day (as msd at sinclair-day dot com) <[email protected]> wrote:
> 
> Invoking the image from the Terminal might be setting the Terminal as the first responder for event handling. Or rather, invoking from the Terminal might omit steps usually taken to configure the runtime environment (via the app bundle’s info.plist) and set the capi window as ‘key’. If you build the image into an app bundle and launch it from the Finder, does it work?
> 
> Something like this...
> 
> (deliver 'test-multi-line-text-input-pane
> 	(create-macos-application-bundle
> 		"socrates.app"
> 		:document-types nil
> 		:identifier "news.synap.socrates")
> 	0 ; minimal reduction of image size results in image about 2 to 3 GB
> 	:interface :capi
> 	:multiprocessing t
> 	:keep-pretty-printer t)
> Matthew
> 
> On 9 Sep 2025, at 18:02, Lawrence Au (as la at synap dot news) wrote:
> 
> Hi,
> 
> I’m trying to deliver the Capi example function test-multi-line-text-input-pane, in a MacOS image I named ‘socrates.image’.
> 
> Although the test-multi-line-text-input-pane run fine when I call (test-multi-line-text-input-pane) from the Listener in the IDE, when I deliver it via the script below, only the button press features work. When I type text into the multi-line-text-input-pane, the text I type into it goes to the stdout of the MacOS terminal session where I launched the delivered image! Nothing goes into the multi-line-text-input-pane! Please help!
> 
> Here’s the script-for-socrates-image-gen.bash script file I used:
> 
> "/Applications/LispWorks 8.0 (64-bit)/LispWorks (64-bit).app/Contents/MacOS/lispworks-8-0-0-macos64-universal" -build "~/release/kernel/lisp-images/socrates-build.lisp"
> 
> And here’s the socrates-build.lisp file I used:
> 
> (in-package "CL-USER")
> ;; this file was generated by calling put-script-for-capi-delivery at universal-time["zone 5 time 5:38:13 date 2025/9/9"]
> ;; to build a custom lisp image at cur-image-file-path "~/release/kernel/lisp-images/socrates.image"
> ;; load the current LispWorks system code:
> (load-all-patches)
> (load "~/release/kernel/pg-lisp/Installers/quicklisp.lisp")
> (load "/Users/lawrenceau/quicklisp/setup.lisp")
> ;; load the pg-lisp system code:
> (load "~/release/kernel/pg-lisp/pg-lisp.lisp")
> (ensure-directories-exist "~/release/kernel/lisp-images/socrates.image")
> (ensure-directories-exist "~/release/kernel/lisp-images/socrates-build.lisp")
> (format t "lisp load script socrates-build.lisp calling deliver to start function 'test-multi-line-text-input-pane now...
> ")
> (deliver 'test-multi-line-text-input-pane
> "~/release/kernel/lisp-images/socrates.image"
> 0 ; minimal reduction of image size results in image about 2 to 3 GB
> :interface :capi
> :multiprocessing t
> :keep-pretty-printer t)
> 
> Lawrence Au
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.