comboBox menu choice validation
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.