Re: drawing NOW in a callback, boom!
Re: drawing NOW in a callback, boom!
- Subject: Re: drawing NOW in a callback, boom!
- From: Cameron Hayne <email@hidden>
- Date: Tue, 4 Jun 2002 21:03:16 -0400
Jonathan E. Jackel wrote:
You're not supposed to touch the GUI from a thread other than the main
thread. This has been discussed ad nauseum.
Jonathan
> I'm redrawing a view from a callback in a thread and crashing.
> I'm not sure why I'm crashing.
While I agree that the original poster's problem is likely due to
incautious cross-thread drawing,
it is NOT true that it is verboten to "touch the GUI from a thread other
than the main thread".
At the bottom of the document on "Thread Safety":
file://localhost/Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/
Multithreading/Concepts/safety.html
is a link "Using the Application Kit from Multiple Threads":
file://localhost/Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/
Multithreading/Tasks/appkit.html
which explains exactly what GUI-related things you can do from another
thread.
You do have to be careful and maybe it is better to try to architect
your program so it can be avoided, but it is not wrong to do so.
... Cameron
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.