Newlines in a NSTextField...still struggling
Newlines in a NSTextField...still struggling
- Subject: Newlines in a NSTextField...still struggling
- From: "Huyler, Christopher M" <email@hidden>
- Date: Fri, 5 Dec 2003 14:02:58 -0500
- Thread-topic: Newlines in a NSTextField...still struggling
Ok, I figured out that by calling "setFieldEditor:NO" on the window's
field editor, I can allow the user to enter newlines in the field.
However, I'm not sure where/how to do this. I am trying the following
in the NSTextField's delegate class:
-(BOOL)control:(NSControl *)control
textShouldBeginEditing:(NSText *)fieldEditor
// when the user
{
if ( control == approvedField )
{
[fieldEditor setFieldEditor:NO];
}
else
{
[fieldEditor setFieldEditor:YES];
}
return YES;
}
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?
--
Christopher Huyler
Computer Associates Intl.
mailto: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.