Re: Hanging Indentation in NSTextField
Re: Hanging Indentation in NSTextField
- Subject: Re: Hanging Indentation in NSTextField
- From: "Greg Wiseman" <email@hidden>
- Date: Mon, 3 Apr 2006 14:15:23 +0200
On 4/2/06, Greg Wiseman <email@hidden> wrote:
...
> However, I'm having a few issues trying to get this working.
>
> First of all, the paragraph style only seems to be applied if I set my
> textfields to be uneditable (setEditable:NO), which is problematic. Am
> I missing something? I don't care if the style isn't applied during
> actual editing (and I could use my previous NSTextContainer subclass
> to do this anyway, I suppose) but when the fields are just being
> displayed, I don't understand why they aren't using the style properly
> unless they're not editable. (Simply changing the flag from NO to YES
> and not changing any other code makes my textfields no longer indent
> the lines).
Once I started assigning the attributedstring in the
controltextdidediting method, I no longer saw this behaviour. I'm not
sure why, something to do with when the field editor is being used I'm
guessing. As a side note, when the fields were uneditable but
selectable, they were properly indented until I tried selecting some
text, and then they snapped back.
> Secondly, the algorithm I was using to calculate the number of lines
> that are in the text view no longer works with this solution.
Well, all of a sudden it works properly now too, after changing the
attributed string assignment to the textDidEndEditing method. Hurray!
And..
> it seems to me
> that the correct number of lines wouldn't be counted (because the
> indentation wouldn't be taken into account).
I'm still replacing the field editor's text container when editing,
and the algorithm does in fact seem to take the indentation into
account.
I'd still appreciate ideas for my inelegant line counting method but
I'm not all that worried about it. Slowly starting to get the hang of
this Cocoa thing :)
-Greg
_______________________________________________
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