Skip navigation.
 
mlediting in a custom NSView
FROM : Torsten Curdt
DATE : Sat Apr 19 01:32:07 2008

Hey guys,

I need some pointers into the right direction.

I would like to create a view that display a list of objects with 
their attributes. Of course NSTableView could do that. But I would 
like the rows to expand vertically when I add more information to the 
object ...and have the attributes not just layed out in column based 
manner. The most simple example: a list of multi line edit fields. 
Example: OmniOutliner - press alt-enter and the line height increases. 
AFAIK you cannot do that with either NSTableView or NSCollectionView 
as the row heights may be different per row.

So I already got a custom view that is manually bound to 
NSArrayController and draws the objects. Now I need to make one of the 
object's string attributes editable. How to do that best?

I assume I could catch the click on the item, then (somehow) show in 
place a NSTextView and have the user do the changes to the text. On 
every change I would check the height of the NSTextView and apply that 
to the drawing of the item. Once done I'll hide the NSTextView again. 
Does that sound like reasonable approach? Or how would you tackle this?

Any suggested example or open source project to look at?

cheers
--
Torsten

Related mailsAuthorDate
mlediting in a custom NSView Torsten Curdt Apr 19, 01:32
mlRe: editing in a custom NSView Mike Manzano Apr 19, 02:01
mlRe: editing in a custom NSView Jens Alfke Apr 19, 03:12
mlcontrols in a NSTableCell (was Re: editing in a custom NSView) Torsten Curdt Apr 19, 04:25
mlRe: editing in a custom NSView Torsten Curdt Apr 19, 04:35