• 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
Disabling buttons in NSSavePanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Disabling buttons in NSSavePanel


  • Subject: Disabling buttons in NSSavePanel
  • From: Michael Domino <email@hidden>
  • Date: Mon, 29 Jun 2009 09:45:48 -0400
  • Thread-topic: Disabling buttons in NSSavePanel

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@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

  • Follow-Ups:
    • Re: Disabling buttons in NSSavePanel
      • From: Steve Christensen <email@hidden>
  • Prev by Date: External Drives Questions
  • Next by Date: Columns widths specified programmatically seem to be wider.
  • Previous by thread: Re: External Drives Questions
  • Next by thread: Re: Disabling buttons in NSSavePanel
  • Index(es):
    • Date
    • Thread