• 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
comboBox menu choice validation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comboBox menu choice validation


  • Subject: comboBox menu choice validation
  • From: Marten van Gelderen <email@hidden>
  • Date: Thu, 19 Feb 2004 14:04:33 +0100

Hallo list,

I have a comboBox with a menu. I validate keyboard text input in the box using: -(BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)textObject. That works fine.

However, when an item from the menu is chosen, I still want to validate the choice: depending on the current working directory in the filesystem, not all (predefined) menu choices are valid. I can send the "... textShouldEndEditing" message myself from -(void)comboBoxWillDismiss:(NSNotification *)notification (which properly brings up an alert sheet if appropriate), but thereafter the user can still tab away from the box even if the sheet indicated that the choice was not good.

Is there a way (similar to overruling the "... textShouldEndEditing" message to react to when typing is done) to prevent the box loosing firstResponder status when a choice in the menu is not good? I have tried overruling -(BOOL)resignFirstResponder in the delegate of my box without any luck.

Any help is appreciated.
--
Groeten, Marten
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: comboBox menu choice validation
      • From: Phillip Mills <email@hidden>
  • Prev by Date: Re: piped unzip (and this time it's not the wrong codesnipper)
  • Next by Date: Re: comboBox menu choice validation
  • Previous by thread: Re: NSString categories
  • Next by thread: Re: comboBox menu choice validation
  • Index(es):
    • Date
    • Thread