Re: Overriding text size in NSTextStorage
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