Re: extending NSSavePanel, how to disable <save> button?
Re: extending NSSavePanel, how to disable <save> button?
- Subject: Re: extending NSSavePanel, how to disable <save> button?
- From: Mike Abdullah <email@hidden>
- Date: Thu, 25 Jun 2009 17:42:27 +0100
I'm pretty certain there is no proper API for disabling the Save
button. But the delegate methods will allow you to stop the button
from taking effect (weird I know). I suggest you do an NSBeep() at the
same time to at least give some feedback as to why the panel couldn't
close.
Mike.
On 24 Jun 2009, at 18:52, Steve Christensen wrote:
I haven't tried myself, but just checking the headers it looks like
the closest thing would be to make your controlling class the
delegate and then implement either
- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename;
or
- (NSString *)panel:(id)sender userEnteredFilename:(NSString
*)filename confirmed:(BOOL)okFlag;
since they control whether to allow the selection process to
complete. The docs for these methods have more details that might
help you decide which would be better.
steve
On Jun 24, 2009, at 10:42 AM, Eric Slosser wrote:
I'm extending NSSavePanel by using an accessory view. The view
contains two NSSecureTextFields, to contain the user-typed password
and confirmation.
I know how to detect when the two password fields don't have
identical content, to display a warning string on the dialog, and
to prevent the user from exiting the dialog.
But I'd also like to disable the <Save> button. Is it possible?
_______________________________________________
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
_______________________________________________
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