
On Sun, Jul 3, 2011 at 10:02 PM, Jason Dagit
Hello,
I'm trying to get some GUI code working on OSX and numerous forums around the internet keep reiterating that on OSX to correctly handle GUI events you need to use the original thread allocated to your process to check for events and to call the Cocoa framework functionality. Specifically, using a secondary thread (even a bound thread) is not sufficient with the Cocoa framework.
Context for others: People explaining that you can't use the secondary thread for GUI operations: http://www.cocoabuilder.com/archive/cocoa/298918-multithread-window-event-ru... http://old.nabble.com/Weird-Carbon%3A-gestalt%3A-wxPython-issue-bug-td274568... http://www.cocoabuilder.com/archive/cocoa/205803-event-loop-in-secondary-thr... http://forums.libsdl.org/viewtopic.php?t=6281&sid=ec818336d68f9797090719b3c5916c21 http://www.cocoabuilder.com/archive/cocoa/292830-nstimer-not-working-in-mult... http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/Multi... http://www.cocoabuilder.com/archive/cocoa/152947-cocoa-multithreading-in-ter... Cocoa provides several ways to run things on the "main thread" (same as I meant when I said original thread): http://blog.jayway.com/2010/03/30/performing-any-selector-on-the-main-thread... http://www.noodlesoft.com/blog/2007/05/01/productive-waste-of-time-figuring-... Jason