Re: How to catch modal window appearance?
Re: How to catch modal window appearance?
- Subject: Re: How to catch modal window appearance?
- From: Ken Thomases <email@hidden>
- Date: Sat, 27 Mar 2010 02:48:39 -0500
On Mar 27, 2010, at 2:28 AM, Alexander Bokovikov wrote:
> On 26.03.2010, at 23:10, Fritz Anderson wrote:
>
>> On 26 Mar 2010, at 11:12 AM, Alexander Bokovikov wrote:
>>
>>> Is there any notification or NSWindow delegate method, called immediately after the modal window is shown on screen? It looks like windowDidExposed doesn't come to a modal window. Is there any solution?
>>
>> Just to check on the obvious points:
>>
>> * Have you set a delegate for the window, which would receive the windowDidExpose: message?
>>
>> * Have you named the method "windowDidExpose:" (without d, with :)?
>
> Yes, it's all done. That was just a typo in the email. I've copy/pasted method declaration from the API Reference, so it's written correctly in the project. Nevertheless it is never called. I suppose that the problem is just the same as with other notifications - I need to do some actions to get them from a modal window message loop. But I have no idea of how to do it in this particular case.
No. I tried to make this point in the earlier thread -- the problem with the NSFileHandle notifications was not the issuing of the notifications. Those happen directly and synchronously as part of posting the notification. They don't involve the runloop or its modes at all. The problem in the earlier thread was the monitoring an external source of events/data. _That_ has to involve the runloop.
NSWindowDidExposeNotification and the windowDidExpose: delegate method are only sent in very specific circumstances. As documented, it only applies to non-retained windows (backing type NSBackingStoreNonretained), which are almost never used.
I'm not really sure what you're asking for. A modal window being shown on screen is not something that happens spontaneously _to_ your application, it's something that your application does. So, whatever you want to do after the window is shown, just do it after the point in your code where you show it.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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