Re: Saving ruler markers to defaults
Re: Saving ruler markers to defaults
- Subject: Re: Saving ruler markers to defaults
- From: Jeremy Dronfield <email@hidden>
- Date: Sat, 17 Aug 2002 12:50:41 +0100
On Friday, August 16, 2002, at 06:32 pm, Douglas Davidson wrote:
On Friday, August 16, 2002, at 10:04 AM, Jeremy Dronfield wrote:
Can anyone tell me how to save the ruler markers in an NSTextView to
user defaults? I'm trying to use -rulerMarkersForTextView: but
trawling the docs has left me unenlightened as to how to fill all the
arguments:
[prefs setObject:[myLayoutManager rulerMarkersForTextView:myTextView
paragraphStyle:???? ruler:????] forKey:@"Tabs"];
Let me suggest that what you actually want to save may not be the state
of the ruler, but the state of the text. Ordinarily the ruler,
markers, and accessories for an NSTextView are merely a reflection of
the paragraph style for the current selection. It is probably the
paragraph style, or some portion of it, that you actually want to save.
Thanks, but no, what I want to save is the state of the tab markers on
the ruler. At least, I *think* that's what I want to save. What I have
is a notepad application which reuses the same NSTextView for a
succession of notes. One note may be some paragraphs of text, the next
may be a list of items aligned left with corresponding tabbed comments
two inches to the right, and so on. I'd like to save the ruler settings
that go with each note, so that when the user returns to add things to
their list, say, they only have to tab once (rather than three or four
times) to put their comments. Or whatever the case may be.
In any case, however, you cannot simply set an arbitrary object as a
default; defaults must be property lists.
Yes, I know. According to the class docs, -rulerMarkersForTextView:
returns an array, which, if documentation and experience don't deal me a
doody, can be set as an object in user defaults. Or can't it in this
case?
-Jeremy
=======================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at
http://freespace.virgin.net/jeremy.dronfield
_______________________________________________
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.