• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Saving ruler markers to defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Saving ruler markers to defaults
      • From: Douglas Davidson <email@hidden>
    • Re: Saving ruler markers to defaults
      • From: Sherm Pendley <email@hidden>
References: 
 >Re: Saving ruler markers to defaults (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: NSDocument:windowControllerDidLoadNib && When are outlets connected to te loaded nib?
  • Next by Date: Re: NSPopUpButton addItemsWithTitles is way slow
  • Previous by thread: Re: Saving ruler markers to defaults
  • Next by thread: Re: Saving ruler markers to defaults
  • Index(es):
    • Date
    • Thread