Re: Detecting if UI thread is running, and creating a UI thread
Re: Detecting if UI thread is running, and creating a UI thread
- Subject: Re: Detecting if UI thread is running, and creating a UI thread
- From: Alexander Dymerets <email@hidden>
- Date: Fri, 02 Mar 2007 19:11:28 +0200
- Organization: The Product Engine (Odessa)
Hello Justin,
Justin Armstrong wrote:
The problem is that we cannot assume the caller of CreateJob() is
actually a Cocoa/Carbon app with a UI thread. If the caller is a
command line app then there will be no UI thread to handle the event
loop and respond to the button click events. So...
If the library can be used in command-line tools, you should not link it
with AppKit. Normally they don't have a Window Server connection. I
think, it would be right to access AppKit classes, such as NSWindow,
with NSClassFromString function. If NSClassFromString returns nil, then
AppKit framework is not loaded and you should not do any UI operations.
Alexander
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden