[Openmcl-devel] Question about objc/cocoa bridge

Paul Krueger plkrueger at comcast.net
Mon Apr 15 08:14:34 PDT 2019


In newer OS versions almost everything having to do with user interfaces must be run on the main event processing thread. It used to just do strange things if you ran things on the wrong thread, but now it at least generates an error. 

If you just run something in the listener window you won’t be running on the main thread.

In my own code I define and use the following macro:

(defmacro on-main-thread (&rest actions)
  `(ccl::call-in-event-process
     #'(lambda ()
         , at actions)))

Then wrap all top-level calls in your code with this macro:

(on-main-thread
   (<your code>))

and I expect the error will go away.

Paul

> On Apr 14, 2019, at 9:48 PM, Yuan Fu <casouri at gmail.com> wrote:
> 
> Hi,
> 
> I just start to learn the objc/cocoa bridge of CCL. However, the example tiny.lisp doesn’t run.
> I can compile it but (TINY-SETUP) gives following error:
> 
> Objective-C runtime exception: 
> NSWindow drag regions should only be invalidated on the Main Thread!
>    [Condition of type NS-EXCEPTION]
> 
> Another question: (REQUIRE "COCOA”) starts a “temp bundle64” app, how can I disable that?
> 
> Thanks,
> Sincerely, Yuan
> 
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20190415/825d75ad/attachment.htm>


More information about the Openmcl-devel mailing list