Re: Outline view questions (hide items & multiple line text)
Re: Outline view questions (hide items & multiple line text)
- Subject: Re: Outline view questions (hide items & multiple line text)
- From: Drew McCormack <email@hidden>
- Date: Tue, 13 Nov 2001 19:20:27 -0800
(2) I have editable text items in my outline. Again, this was easy -
for single line text items. I'd like some of my text items to be able
to expand to multiple lines of text, rather than just be a single line.
Any tips on making this work easily?
I'm afraid you will have to join the queue, Michael. There have been
several people trying to do this, and, to my knowledge, nobody has
succeeded. That's not entirely true, because I have been in
communication with Steve Nygard who worked on OmniOutliner, and he did
it (see OmniOutliner), but only by writing a whole new Outline class
(around 7000 lines).
I gave it a good shot, and I am convinced it could be done by
subclassing NSOutlineView, but I couldn't figure out exactly how to do
it, and nobody on this list was really able to help. I was actually
subclassing NSTableView, but the principal should be the same. I was
able to get rows to resize as text was entered by overriding the layout
methods of NSTableView (eg rectOfRow, frameOfCell:withRow:column). This
worked well, but the field editor, which is actually a shared instance
of NSTextView, would not resize to fit the resized cell; instead, the
text would just scroll. I tried setting all sorts of parameters for the
field editor, and its NSTextContainer, but could not get it to resize.
I'm sure it could be done, but I couldn't figure out how.
If you have any ideas about how I could do this, let me know. If you
want the code from my attempt, just ask. It's not pretty, but it is a
start.
Drew McCormack