• 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: Overriding text size in NSTextStorage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding text size in NSTextStorage


  • Subject: Re: Overriding text size in NSTextStorage
  • From: "Paul Sanders" <email@hidden>
  • Date: Mon, 10 May 2010 22:44:19 +0100

> OK, tried that. I couldn't do anything there that would force glyph generation or layout because it is between a begin and end editing.


I was able to achieve something similar to what you are trying to do by overriding [NSTextView didChangeText].  At that point, I am able to change the text in the view before calling super, but make sure that you test that you are not in an undo otherwise bad things will happen if you monkey with the text.

To know what range of text has been most recently changed, I stash this in an iVar in shouldChangeTextInRange:affectedCharRange:replacementString:  It ain't pretty, and there's probably some detail to work out, but it works for me.

Paul Sanders.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Overriding text size in NSTextStorage (From: Gideon King <email@hidden>)
 >Re: Overriding text size in NSTextStorage (From: Jens Alfke <email@hidden>)
 >Re: Overriding text size in NSTextStorage (From: Gideon King <email@hidden>)
 >Re: Overriding text size in NSTextStorage (From: Kyle Sluder <email@hidden>)
 >Re: Overriding text size in NSTextStorage (From: Gideon King <email@hidden>)

  • Prev by Date: Re: self = [super init], nil?
  • Next by Date: 32/64-bit transition and memory expansion
  • Previous by thread: Re: Overriding text size in NSTextStorage
  • Next by thread: Re: Overriding text size in NSTextStorage
  • Index(es):
    • Date
    • Thread