Re: NSTextView - text wrapping
Re: NSTextView - text wrapping
- Subject: Re: NSTextView - text wrapping
- From: Ian was here <email@hidden>
- Date: Thu, 5 May 2005 19:20:50 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Just trying to do bullets in my text view the pre-OS X
10.4 way. It's painful looking at all the latest and
greatest text support features in 10.4, but not being
able to use them. I need to be backward compatible
with OS X 10.3.
Everything works great, except for that one issue. If
you hit the Return or Enter key, a bullet and tab are
inserted into the next line. If you hit the delete key
the bullet and tab are removed and the cursor goes
back to the previous line. All the typical behavior
you would expect with bulleted text (like MS Word).
The problem is when you keep typing to the right-most
edge of the text view; the cursor moves to the next
line as it's suppose to, it's just that I want to
insert a tab so the text lines up with the text above
it. I don't want text appearing directly under a
bullet.
OK, so the tab insertion is forcing the layout manager
to fire again. Unless I misread the documentation, the
(BOOL)shouldBreakLineByWordBeforeCharacterAtIndex:(unsigned)charIndex:
method should only get fired when the cursor about to
move to the next line. hmm... :-|
--- Johnny Deadman <email@hidden> wrote:
> off the top of my head and without having done any
> testing I would
> guess that your insertion of a tab is forcing the
> layout manager to
> do the layout again, which is why this is getting
> called repeatedly.
> It is probably not a good idea to edit the backing
> store during layout.
>
> what are you trying to do? maybe there is a better
> way.
>
>
> On 5-May-05, at 2:49 PM, Ian was here wrote:
>
> > OK, I looked in the NSATSTypeSetter class and
> found
> > -
> >
>
(BOOL)shouldBreakLineByWordBeforeCharacterAtIndex:(unsigned)charIndex:
> >
> > I subclassed NSATSTypeSetter and inserted a tab
> into
> > my text view's string each time it was envoked
> > (according to the documentation, it's envoked each
> > time a word wrap takes place). The problem I'm
> having
> > is that it is being called several times between
> line
> > wraps. Is this a bug?
>
>
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
_______________________________________________
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