[Openmcl-devel] Three questions

R. Matthew Emerson rme at clozure.com
Fri Feb 8 14:34:09 PST 2008


On Feb 8, 2008, at 4:34 PM, Ron Garret wrote:

> 1.  Is there a way to tell when a window has been closed?

I only know of the usual Cocoa/Objective-C ways:
   * register to receive NSWindowWillCloseNotification
   * implement windowWillClose: in the window's delegate

> 2.  Why doesn't this work:
>
> (objc:load-framework "Webkit" :webkit)
> (setf w (make-window 500 300))
> (setf v (make-instance 'ns:web-view))
> (#/setContentView: w v)
> (setf f (#/mainFrame v))
> (#/loadRequest: f
>   (#/requestWithURL: ns:ns-url-request
>     (#/URLWithString: ns:ns-url #@"http://www.google.com/")))

WebKit really needs to be called only from the main thread.  Please  
see ccl:examples;webkit.lisp for an example of using  
performSelectorOnMainThread:withObject:waitUntilDone: to do this very  
thing.

(Every listener in the IDE has its own thread.)





More information about the Openmcl-devel mailing list