<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">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. <div class=""><br class=""></div><div class="">If you just run something in the listener window you won’t be running on the main thread.<br class=""><div class=""><br class=""></div><div class="">In my own code I define and use the following macro:</div><div class=""><br class=""></div><div class="">(defmacro on-main-thread (&rest actions)<br class=""> `(ccl::call-in-event-process<br class=""> #'(lambda ()<br class=""> ,@actions)))</div><div class=""><br class=""></div><div class="">Then wrap all top-level calls in your code with this macro:</div><div class=""><br class=""></div><div class="">(on-main-thread</div><div class=""> (<your code>))</div><div class=""><br class=""></div><div class="">and I expect the error will go away.</div><div class=""><br class=""></div><div class="">Paul</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 14, 2019, at 9:48 PM, Yuan Fu <<a href="mailto:casouri@gmail.com" class="">casouri@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I just start to learn the objc/cocoa bridge of CCL. However, the example tiny.lisp doesn’t run.</div><div class="">I can compile it but (TINY-SETUP) gives following error:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class="">Objective-C runtime exception: </div></div><div class=""><div class="">NSWindow drag regions should only be invalidated on the Main Thread!</div></div><div class=""><div class=""> [Condition of type NS-EXCEPTION]</div></div></blockquote><div class=""><div class=""><br class=""></div></div><div class="">Another question: (REQUIRE "COCOA”) starts a “temp bundle64” app, how can I disable that?</div><div class=""><br class=""></div><div class="">Thanks,<br class=""><div class="">
<div style="font-family: 'Source Serif Pro'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Sincerely, Yuan</div>
</div>
<br class=""></div></div>_______________________________________________<br class="">Openmcl-devel mailing list<br class=""><a href="mailto:Openmcl-devel@clozure.com" class="">Openmcl-devel@clozure.com</a><br class="">https://lists.clozure.com/mailman/listinfo/openmcl-devel<br class=""></div></blockquote></div><br class=""></div></div></body></html>