NSTextView autoresizing vertically
NSTextView autoresizing vertically
- Subject: NSTextView autoresizing vertically
- From: Ian was here <email@hidden>
- Date: Tue, 30 Aug 2005 16:58:45 -0700 (PDT)
Hi,
I have created an NSTextView of a given size that one
can type into. If you type more than can fit into the
text view, I would like it to extend vertically to
show the additional text. I have spent some time on
this problem with no success. It should be a fairly
easy task.
- (void)textChanged:(NSNotification *)notify
{
NSSize textSize = [[textView
layoutManager]usedRectForTextContainer:[textView
textContainer]].size;
NSSize textViewSize = [textView bounds].size;
if ( textSize.height + 10.0 > textViewSize.height )
{
[textView setFrameSize:textSize];
}
}
This code gives an odd error message:
Exception raised during posting of notification.
Ignored. exception: -[NSLayoutManager
_fillGlyphHoleAtIndex:desiredNumberOfCharacters:] ***
attempted glyph generation while textStorage is
editing. It is not valid to cause the layoutManager
to do glyph generation while the textStorage is
editing (ie the textStorage has been sent a
beginEditing message without a matching endEditing.)
Thanks :)
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
_______________________________________________
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