Sync NSOutlineView and NSTextView for outliner
Sync NSOutlineView and NSTextView for outliner
- Subject: Sync NSOutlineView and NSTextView for outliner
- From: Keith Blount <email@hidden>
- Date: Sun, 17 Jul 2005 03:48:24 -0700 (PDT)
Hello,
I am hoping somebody might have some conceptual advice
on how to approach the following problem:
As part of the app I'm working on, I would like to
include an outliner like the one in Mellel or like
Jer's Novel Writer. The set-up would be like this:
There would be an outline view on the left and a text
view on the right. Whenever an item is added to the
outline view, a new text section is simultaneously
added to the text view. (This part is straightforward,
as I can just inset the text at the same time as
inserting the item in the outline view.)
Thus, each item in the outline view should represent a
block of text in the text view. Whenever an item is
moved around (eg. through drag'n'drop) in the outline
view, it should also be moved around in the text view.
And vice versa - if the user cuts and pastes a section
to a different place in the text view, the outline
view should reflect that.
At the moment I'm at a bit of a loss as to the best
way to approach this. I am thinking that whenever the
user adds an item to the outline view, I could add
some text with the same title as the item into the
text view, with a custom attribute set to that text
referencing the item in the outline view, but there
are still a lot of conceptual problems here - for
instance, tracking what level an item should be at
when moved around in the text view.
If anyone has any suggestions at all, I would be very
grateful.
Many thanks,
Keith
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden