• 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: Right way to build style sheets?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Right way to build style sheets?


  • Subject: Re: Right way to build style sheets?
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 13 Nov 2002 12:16:04 -0800

On Wednesday, November 13, 2002, at 11:54 AM, Steve Mykytyn wrote:

I need to keep a list of styles for text: font, size, style, color, etc.

for the user interface, i'd like to have the user simply change any/all of those for a fixed string of text, like "Sample", or perhaps have the text change in response to the chosen attributes, e.g. "Helvetica 24 bold".

Is it possible to have an NSTextView where users can edit attributes but not text? I'm guessing not...

If you give your NSTextView a delegate, the delegate can approve or deny any changes the user may make. It should be fairly straightforward to allow only those changes that modify attributes--something like this (untested):

- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString {
// Delegate only. If characters are changing, replacementString is what will replace the affectedCharRange. If attributes only are changing, replacementString will be nil.
return (replacementString == nil);
}
_______________________________________________
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.
References: 
 >Right way to build style sheets? (From: Steve Mykytyn <email@hidden>)

  • Prev by Date: Re: Cocoa WebObjects
  • Next by Date: Re: Cocoa WebObjects
  • Previous by thread: Re: Right way to build style sheets?
  • Next by thread: Re: Right way to build style sheets?
  • Index(es):
    • Date
    • Thread