• 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
Altering range for font changes in NSTextView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Altering range for font changes in NSTextView?


  • Subject: Altering range for font changes in NSTextView?
  • From: Scott Lehman <email@hidden>
  • Date: Thu, 27 Apr 2006 00:18:07 -0700 (PDT)

Hi,

I've got an NSTextView subclass that has bulleted
lists.  If the user selects a range that happens to
include a bullet, I don't want changes to font traits
(i.e. bold or italic) to affect the bullet.

After reading up on the font system, I tried
overriding NSTextView's changeFont: method to call
setSelectedRanges: to exclude bullets before invoking
super's implementation.  However even after setting
the ranges (and querying to make sure they're set),
super invokes shouldChangeTextInRange:
replacementString: with the old selection range, and
no font change actually occurs.  The delegate does
implement
textView:shouldChangeTextInRanges:replacementStrings:
to return YES.

Is there something else needed to make this work, or
do I need to manually convert and set the fonts in the
multiple ranges myself?

Thanks,

Scott

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Cocoa and other languages, was: .Mac support to C/C++ application
  • Next by Date: Re: NSNumberFormatter and localized format problem
  • Previous by thread: Re: unit test subclassing
  • Next by thread: How to retrieve currencies list
  • Index(es):
    • Date
    • Thread