typingAttributes not updating ruler or insertion point?
typingAttributes not updating ruler or insertion point?
- Subject: typingAttributes not updating ruler or insertion point?
- From: Keith Blount <email@hidden>
- Date: Sat, 2 Sep 2006 16:41:11 -0700 (PDT)
Hello,
I have a text view that does some auto-formatting. In
order to do this, it changes certain attributes
(including indents etc) when the user makes certain
text changes (returns etc). This is done through the
delegate methods. These detect what the next set of
attributes should be, and these are set in
-textDidChange: using NSTextView's
-setTypingAttributes: This works absolutely fine -
until the user comes to edit text that has already
been created. In this case - in other words, when
there is text after the insertion point - hitting
enter will change the typing attributes (as determined
in my delegate methods), but there is no indication of
this - the ruler and insertion point stay as they
were; they do not reflect the current typing
attributes. Only when the user starts to type does the
ruler and insertion point get updated.
This can be disorientating. For instance, the user may
expect, in some situations, hitting enter to not only
move to the next line but also change the typing
attributes for the new block of text from left aligned
to center aligned, and therefore now to see the cursor
in the centre of the line. And this is exactly what
will happen if editing at the end of the text. But
editing in the middle of the text in this situation,
the cursor will remain left-aligned until the user
beings to type, when it will leap to the centre.
It seems that in this case the ruler and insertion
point rely on the text around the insertion point
rather than the actual typing attributes. To try to
get around this, I tried setting the attributes of
newlines to the attributes that would be expected on
the next line. But this seemed to have no effect
either.
Is there any way to change this behaviour? The ideal
would be to force the ruler and insertion point to
reflect typing attributes even when the selection is
in the middle of the text...
Thanks,
Keith
__________________________________________________
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