Re: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
That's good to know - I'll keep an eye out for it. Gideon On 11/05/2010, at 9:40 AM, Gordon Apple wrote: > There is a bug in the text system, which I have reported and filed > previously. If you programmatically change the text, the KVO for the > bindings is not triggered and will not update th

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Gordon Apple
There is a bug in the text system, which I have reported and filed previously. If you programmatically change the text, the KVO for the bindings is not triggered and will not update the text storage. If you then use the keyboard for another edit, it will trigger it and will commit both changes.

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
Oh I tried that too, but it made no difference, so was looking to find something that would force the layout. Considering the symptoms, I think that the update to the position of the text is happening in the text view is happening before it gets anywhere near the back end, and nothing I am doing

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Paul Sanders
> 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 tex

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Kyle Sluder
On Mon, May 10, 2010 at 11:07 AM, Gideon King wrote: > 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. Okay... why would you want to force glyph generation or layout? That notification is your opportunity t

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
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. On 11/05/2010, at 3:16 AM, Kyle Sluder wrote: > > You want to implement -textStorageWillProcessEditing: in your text > storage delegate. __

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
Yeah, I thought that too, and tried calling glyphRangeForTextContainer: which is apparently supposed to force a re-layout, and also textContainerChangedGeometry: which I have used successfully in the past to get around some similar layout issues. Neither worked. Regards Gideon > It’s the lay

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Kyle Sluder
On Mon, May 10, 2010 at 9:19 AM, Gideon King wrote: > From a practical point of view, I haven't found a delegate method that allows > you to alter the proposed attributes. The closest one is one that acts on > proposed typing attributes, and I assume that could change with moving the > insertio

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Jens Alfke
On May 10, 2010, at 9:19 AM, Gideon King wrote: > From a conceptual point of view, my understanding of MVC means that a user > initiated action should be reflected in the model (text storage), which > should push it through to the view, which should mean that doing the changes > in the text st

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
From a practical point of view, I haven't found a delegate method that allows you to alter the proposed attributes. The closest one is one that acts on proposed typing attributes, and I assume that could change with moving the insertion point, as well as when changing attributes, and would presu

Re: Overriding text size in NSTextStorage

2010-05-10 Thread Jens Alfke
On May 10, 2010, at 4:54 AM, Gideon King wrote: > Hi, I am trying to override the setting of text size in my text storage > subclass. I have overridden the setAttributes:range: method, and told the > text to use a standard font size (keeping the other font attributes), but > when I am editing,

Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
Hi, I am trying to override the setting of text size in my text storage subclass. I have overridden the setAttributes:range: method, and told the text to use a standard font size (keeping the other font attributes), but when I am editing, and use the font panel to set the font, although the corr