Re: Newlines in a NSTextField...still struggling
Re: Newlines in a NSTextField...still struggling
- Subject: Re: Newlines in a NSTextField...still struggling
- From: Douglas Davidson <email@hidden>
- Date: Fri, 5 Dec 2003 11:55:11 -0800
On Dec 5, 2003, at 11:02 AM, Huyler, Christopher M wrote:
However, this delegate function only gets called if I am about to edit
the field. I have to attempt to change something in the field to get
this to run. After that I can insert newlines all I want. This does
not work when the first character I want to type is a newline.
Is there a better way to do this?
Yes. Try this instead:
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView
doCommandBySelector:(SEL)commandSelector {
BOOL retval = NO;
if (commandSelector == @selector(insertNewline:)) {
retval = YES;
[textView insertNewlineIgnoringFieldEditor:nil];
}
return retval;
}
Douglas Davidson
_______________________________________________
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.