• 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: Chuck Norris <email@hidden>
  • Date: Thu, 18 Oct 2001 11:39:16 -0700

This is helpful - at least I know it *should* work. I'll simplify to a minimalist example and then we can talk.

Regards,

Chuck

At 10:42 AM -0700 10/18/01, Douglas Davidson wrote:
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
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Re: NSTextView and setFont - bug or feature? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: NSTextView and setFont - bug or feature?
  • Next by Date: Re: NSTextView and setFont - bug or feature?
  • Previous by thread: Re: NSTextView and setFont - bug or feature?
  • Next by thread: NSOutlineView and setDoubleAction
  • Index(es):
    • Date
    • Thread