Re: NSTextField, NSTextFieldCell, NSTextView... this is a mess, I need help
Re: NSTextField, NSTextFieldCell, NSTextView... this is a mess, I need help
- Subject: Re: NSTextField, NSTextFieldCell, NSTextView... this is a mess, I need help
- From: Daryn <email@hidden>
- Date: Fri, 11 Jul 2003 17:45:22 -0500
On Friday, July 11, 2003, at 05:20 PM, Sailor Quasar wrote:
On Friday, July 11, 2003, at 05:28 PM, Daryn wrote:
If you directly use a text view (ie. forget about a text field,
configure the view to look and act like a field), then there is no
need to worry about swapping in a custom field editor -- the text
view IS the field editor. Simply implement keyDown:.
Sounds an easy, elegant, perfect solution... until you look at the two
problems:
1) I can't define a custom NSTextView subclass in IB, nor can I size
it to the required height.
Sure you can. Create the class, then use a "custom view" and change
its class to your subclass. I think I've read notes on this list that
a text view needs to be in a scroll view to function properly, so keep
that in mind.
2) NSTextView is not a subclass of NSControl or NSActionCell, and
therefore does not have a -sendAction,
Use setFieldEditor:YES and implement textDidEndEditing: in your custom
text view's delegate. Check if the notification was caused by
NSReturnTextMovement. If so, send your action.
Maybe I'm just crazy. The compiler warnings for multicharacter
constants when I do comparisons like [string characterAtIndex:0] ==
'\0#' are driving me slowly insane. I know that's really not a good
tactic to use, but I can guarantee that the input to my NSStrings is
pure 7-bit ASCII so I can afford to assume that the UniChar output
always has a 0x00 high byte.
Why not cast the LHS to a char, or the RHS to a unichar?
Daryn
_______________________________________________
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.