How can I display a dialog in one non-main thread?
How can I display a dialog in one non-main thread?
- Subject: How can I display a dialog in one non-main thread?
- From: "Dan" <email@hidden>
- Date: Sat, 20 Sep 2003 10:56:19 +0800
Dear All:
I have some problem about AppleScript , cocoa Multithread.
In Main Thread, I create a new thread:
...
[NSThread detachNewThreadSelector:@selector(thread1:) toTarget:self withObject]
...
In thread1, I only display a dialog:
- (void) thread1
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *script = [[NSString alloc] initWithFormat:
@"display dialog \"Hello Thread1\"];
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script];
NSMutableDictionary *errors = [NSMutableDictionary dictionary];
[appleScript executeAndReturnError:&errors];
[appleScript release];
[script release];
[pool release];
}
But there only show a blank dialog, there is no any text and button on dialog.
How can I do that? Who can help me?
Thanks a lot!
Best Regards
Dan
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.