Hi, I use an NSSavePanel to select a file, enter and confirm a password, encrypt it and save a copy with a new extension. There is an accessory view for entering and confirming a password. I would like the OK button to be disabled while there is no file selection, and if the password/confirm password fields are empty and/or don¹t match. I use NSNotificationCenter to observe the text fields to check whenever the user enters text and enable/disable the OK button. This all nearly works, the only problem is that when you select a file, the OK button is enabled and I have not been able to find a hook or delegate method that will allow me to override this behavior. I tried observing for changes to _nameField, to see if maybe I could set the enabled state for the button there, but my method is not called even though the delegate is set.
What about finding the NSButton view in the dialog window (search for the view title ³OK²), replacing it with my own subclass of NSButton to override setEnable to include the additional criteria? The other thing is that I¹m referencing the _okButton and _nameField outlets in NSSavePanel that do not have accessors, so I get the warning about that being a hard error in the future, which makes me nervous. Has anyone needed to solve this problem, and if so how did you do it? Thanks, Michael -- Michael Domino [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
