• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: My alert sheet looses focus in second thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My alert sheet looses focus in second thread


  • Subject: Re: My alert sheet looses focus in second thread
  • From: j o a r <email@hidden>
  • Date: Thu, 6 Jan 2005 13:19:41 +0100


On 2005-01-06, at 13.12, Peter Karlsson wrote:

How do I set focus to my alert sheet? It's opened in my second thread like
this:


NSBeginAlertSheet(@"I have a message for you", @"Close", nil, nil,
myWindowOutlet, self, nil, nil, nil, blah);

...and I think the second thread is the reason it looses the focus.

Read and grok:

<http://developer.apple.com/documentation/Cocoa/Conceptual/ Multithreading/Concepts/safety.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ Multithreading/Tasks/appkit.html>
<http://www.cocoadev.com/index.pl?ThreadSafety>


Never expect to be allowed to do anything in a non-main thread if it's not explicitly stated that what you attempt to do is thread safe.

j o a r

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >My alert sheet looses focus in second thread (From: "Peter Karlsson" <email@hidden>)

  • Prev by Date: My alert sheet looses focus in second thread
  • Next by Date: Re: [OT] user banned from the list
  • Previous by thread: My alert sheet looses focus in second thread
  • Next by thread: RE: scaleUnitSquareToSize: weirdness (workaround found)
  • Index(es):
    • Date
    • Thread