End Editing with RETURN
End Editing with RETURN
- Subject: End Editing with RETURN
- From: Lorenzo <email@hidden>
- Date: Thu, 05 Jun 2003 20:18:00 +0200
Hi,
I have some NSTextFields (of my subclass) in a Window.
I want that when the user presses RETURN, more than ending the editing, I
perform an action. I found the delegate methods very useful.
Anyway, the following
- (void)textDidEndEditing:(NSNotification *)aNotification
{
NSLog(@"textDidEndEditing");
}
has been executed any time the user presses TAB or RETURN.
How could I detect the user ended to edit the field pressing a RETURN?
Is this info nested inside the aNotification
The documentation says that:
If the user ended editing by pressing Return, this method tries to send the
receiver's action to its target;
So I tried in many ways to assign an action to the NSTextField subclass
a) [self setAction:@selector(ApplyChanges)];
b) [(NSControl*)self setAction:@selector(ApplyChanges)];
c) [(NSCell*) self setAction:@selector(ApplyChanges)];
and/or [self setTarget:self];
and
- (void)ApplyChanges
{
NSLog(@"ApplyChanges");
}
but it doesn't work. Why?
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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.