Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hanging Indentation in NSTextField



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Hanging Indentation in NSTextField (From: "Greg Wiseman" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.