• 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
Editing a NSTextFieldCell with attributed string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Editing a NSTextFieldCell with attributed string


  • Subject: Editing a NSTextFieldCell with attributed string
  • From: Dan Bernstein <email@hidden>
  • Date: Wed, 5 Dec 2001 09:37:30 +0200

I have a NSTextFiledCell that I initialize with initTextCell:@"" and then send it setAttributedStringValue: with an attributed string containing different text colors for different ranges. When I send it drawInteriorWithFrame:inView: it draws fine, including the colors.

However, later when I send it editWithFrame:inView:editor:delegate:event:, the field editor displays everything in black. As editor: I pass an NSTextView I create myself(*) in my initialization method as follows: [[NSTextView alloc] init].

The question is, of course, what should I do in order to make the field editor respect the string attributes.

(*) There's supposed to be a "shared field editor for all NSCells" but I have no idea how to obtain it or whether I should use it. There's also a shared window field editor supplied by NSWindow, but I don't think I want to use that either. When I did, it behaved just like my private NSTextView did.

TIA,
-- Dan Bernstein


  • Follow-Ups:
    • Re: Editing a NSTextFieldCell with attributed string
      • From: Max Horn <email@hidden>
  • Prev by Date: Using a nib's window for a sheet?
  • Next by Date: Re: Editing a NSTextFieldCell with attributed string
  • Previous by thread: Re: Using a nib's window for a sheet?
  • Next by thread: Re: Editing a NSTextFieldCell with attributed string
  • Index(es):
    • Date
    • Thread