On Mar 3, 2010, at 11:43 AM, Jens Alfke wrote:

> 
> On Mar 3, 2010, at 7:20 AM, Eric Gorr wrote:
> 
>>> Otherwise, you can make your class implement the NSWindow delegate method 
>>> -windowShouldClose:, which will also be called when the user tries to close 
>>> the window. 
>> 
>> This method is called after I press the close (red) button. My only concern 
>> here is that the method does not necessarily lend itself to be exclusively 
>> called at this time and it would be a problem if it was ever called if the 
>> window was being closed for any other reason.
> 
> No offense, but why do you need to distinguish between these? It might be a 
> bad user interface design — for example, have you considered that some 
> disabled users have trouble with precise gestures and use keyboard 
> equivalents whenever possible?

It is entirely possible that the general design of the code is poor. 
Unfortunately, that knowledge won't help me solve the problem in front of me 
nor would I be able to do anything about it at this time, if true. I suppose we 
could turn this into a discussion of the general design, but I was hoping to 
avoid that as it would simply not be practical to alter it at this time, but 
then, such things can be generally useful for future reference.

> I can assure you that -windowShouldClose: is only called in response to 
> direct user interaction, and is often used to put up a confirmation sheet.

This is good news. 

>> So, how certain is it that it will _only_ be called if the user presses the 
>> close (red) button?
> 
> It's also called if the user chooses the Close menu command or presses Cmd-W.

Good to know.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to