• 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
extending an NSTextView shape
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

extending an NSTextView shape


  • Subject: extending an NSTextView shape
  • From: Michael Hanna <email@hidden>
  • Date: Wed, 1 Mar 2006 13:54:28 -0800

Hello, after the user enters an NSString, I have it displayed in an NSView subclass the same way it is done in Sketch sample code (SKTTextArea.m)

I use the -setContents: method to put the string in the text view. I can successfully do this, and I use
NSAttributedString -size and pass it to -setBounds: to set the width of the text area, but the height gets truncated like this:


http://img303.imageshack.us/img303/2718/textareatooshort8va.png

I'm not sure how to set the bounds to the size of the text. Is that the bounds of the textcontainer? If so I have tried something like this in setContents:

		NSLayoutManager *lm = sharedDrawingLayoutManager();
		NSTextContainer *tc = [[lm textContainers] objectAtIndex:0];
		NSSize newSize = [tc containerSize];
		NSRect currBounds = [self bounds];
		currBounds.size = newSize;
		[self setBounds:currBounds];

but the first line gives me a warning:
warning: initialization makes pointer from integer without a cast

not sure what this means. Is that route a dead-end? Any suggestions? I'm essentially using the SKTTextArea.m code unchanged.

Mike

--
Mike Hanna
email@hidden
iChat: michaelkhanna(AIM)



_______________________________________________
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


  • Prev by Date: NSTextField Masking
  • Next by Date: Re: NSCalendar bug with adding to pre-1919 dates?
  • Previous by thread: Re: NSTextField Masking
  • Next by thread: Reading raw jpeg data
  • Index(es):
    • Date
    • Thread