• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextView autoresizing vertically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSTextView autoresizing vertically
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: making a copy of text in document window
  • Next by Date: Re: NSTextView autoresizing vertically
  • Previous by thread: Re: making a copy of text in document window
  • Next by thread: Re: NSTextView autoresizing vertically
  • Index(es):
    • Date
    • Thread