[mac-lisp-ide] runloops, threads, etc.

Duncan Rose duncan at robotcat.demon.co.uk
Thu Feb 5 23:07:56 UTC 2004


On Thursday, February 5, 2004, at 10:58 PM, mikel evins wrote:

>
> On Feb 5, 2004, at 2:39 PM, Duncan Rose wrote:
>
>> The add-event-to-queue method converts the Cocoa event into a CLIM 
>> event and appends it to a list; the McCLIM event processing pops 
>> events off the list when it wants them and does its stuff. This 
>> provides a mechanism allowing Cocoa to force events on the back end 
>> code, and for CLIM to request them as needed.
>>
>>
>
> Seems like it should be possible to make a thread for CLIM that waits 
> on this queue, so that each time you enqueue a synthesized event the 
> CLIM thread wakes up and dequeues it.
>
> When you hand events to the CLIM code, do you tell Cocoa that the 
> event was handled? Whichever way you answer there may be subtleties 
> that could cause weird behavior; some events are meant to be handled 
> by the first responder and that's it; others are meant to be 
> maybe-handled by the first responder and then maybe handed off to one 
> or more other responders. Finally, Command-key events traverse the 
> responder chain *backwards* so that the application has first chance 
> to process them.
>
>

Currently (disclaimer: pre-pre-alpha 8-) any event that's of a type 
CLIM would be interested in gets put onto the event list for CLIM. Any 
other events continue up the responder chain as normal. (This seems to 
be acceptable for most events. Mouse moved events get sent to the 
window irrespective of where the mouse is - CLIM probably isn't too 
interested in these if they don't happen over a CLIM window).

I only handle key events in my lisp-window NSWindow subclass at the 
moment in any case, so *at the moment* it doesn't make any difference 
if they go up or down. There's no event handling in the NSApplication.

I can't say I'm particularly happy with the way I'm handling events at 
the moment; or, to be honest, with the way I'm handling anything else 
either! (I'm thinking at the moment it may have been a bad idea to 
attempt to "Cocoaify" the CLX back end, which is what I've done in 
effect, rather than start from scratch.)

-Duncan

>
> _______________________________________________
> mac-lisp-ide site list
> mac-lisp-ide at common-lisp.net
> http://common-lisp.net/mailman/listinfo/mac-lisp-ide
>





More information about the Mac-lisp-ide mailing list