• 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: NSTextView and setFont - bug or feature?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView and setFont - bug or feature?


  • Subject: Re: NSTextView and setFont - bug or feature?
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 18 Oct 2001 10:42:27 -0700

On Wednesday, October 17, 2001, at 11:54 PM, Chuck Norris wrote:

I have a NSTextView that is not editable. However, I want to be able to set the font programmatically. I'm finding, however, that setFont does not work unless the NSTextView is set editable. If I'm not mistaken, this behavior changed from 10.0.4 to 10.1, but that's beside the point except to indicate a possible bug has crept in.

There are two questions. One, how do I set the font of an uneditable NSTextView? It's kinda painful to do:

[myView setEditable: YES];
[myView setFont: aFont];
[myView setEditable: NO];

Plus, if I do this, the font change never seems to "take", probably because handling of the setFont is handled asynchronously somehow (interesting to note this, however - I wouldn't have thought it...). If I just set editable (and don't disable it), everything works great. If I wait long enough (probably allowing the event loop to cycle), I can disable editing again and the change "takes".

NSTextView's setFont: method really does little more than set the font on the text storage and in the typing attributes, so this seems surprising to me. I just built a simple example, and wasn't able to reproduce this. Have you tried operating on the text storage directly? Can you reduce this to a minimal test case?

Douglas Davidson


  • Follow-Ups:
    • Re: NSTextView and setFont - bug or feature?
      • From: Chuck Norris <email@hidden>
    • Re: NSTextView and setFont - bug or feature?
      • From: Ali Ozer <email@hidden>
References: 
 >NSTextView and setFont - bug or feature? (From: Chuck Norris <email@hidden>)

  • Prev by Date: Re: launchApplication (NSWorkSpace) : the icon is always displayed
  • Next by Date: Re: Adding some polar coordinate capabilities to NSBezierPath.
  • Previous by thread: NSTextView and setFont - bug or feature?
  • Next by thread: Re: NSTextView and setFont - bug or feature?
  • Index(es):
    • Date
    • Thread