Re: NSTableView and NSTextView
Re: NSTableView and NSTextView
- Subject: Re: NSTableView and NSTextView
- From: Drew McCormack <email@hidden>
- Date: Thu, 18 Oct 2001 10:11:21 +0200
On Wednesday, October 17, 2001, at 09:31 , Douglas Davidson wrote:
On Wednesday, October 17, 2001, at 08:47 PM, Drew McCormack wrote:
I want to have an NSTableView such that a cell can be edited, and when
the return/enter is hit, the row grows and the cell doesn't stop
editing. In other words, I would like NSTextView like behavior in an
NSTableView. Only problem is, there is no NSTextViewCell. What is the
best way to go about this?
When a cell is being edited, it gets a field editor, which is an
NSTextView. Normally this textview has been configured to end editing
on a return or tab, by sending it setFieldEditor:YES. If you send it
setFieldEditor:NO, then it will behave like a standard textview. There
are a number of places where you might do this; the NSCell method
setUpFieldEditorAttributes: comes to mind.
I'm a little confused by this. It seems logical enough, until I read the
docs for NSTableColumn, which states that the default cell is of type
NSTextFieldCell. NSTextField does not derive from NSText, and so doesn't
have the method "setFieldEditor:".
Yet, what you are saying seems right, because NSCell does have a method
setFieldEditorAttributes:(NSText *)textObj, so I could send the
"setFieldEditor:" message to the NSText object passed in. I will try
this, and I'm sure it will work, but can you perhaps tell me where my
understanding is breaking down? Where does the NSText object passed to
"setFieldEditorAttributes:" come from, because the NSTableColumn has
NSTextFieldCell's, and these are not NSText objects?
Drew McCormack