Re: NSTextView/NSTextField Question
Re: NSTextView/NSTextField Question
- Subject: Re: NSTextView/NSTextField Question
- From: Andrew Mortensen <email@hidden>
- Date: Thu, 3 Jan 2002 14:18:42 -0500 (EST)
Try this:
(assuming an instance of NSTextView or a subclass called textView)
NSString *longString = [ textView string ];
The -string method is found in NSText, which NSTextView inherits. It
should return the entire contents of the NSTextView.
andrew
On Thu, 3 Jan 2002, Mike Brinkman wrote:
>
I just made an item editor for a simple game I'm making. It consists of
>
several NSTextFields and an NSTableView for storing the info once I add an
>
item. For the text fields, I'm using [item setObject:[itemName stringValue]
>
forKey:@"itemName"]; to store the info into the table for the text fields.
>
>
One of the fields is an item description. I've got it stretched so it can
>
accommodate 3 lines of text, but the possibility exists that the description
>
could be longer than 3 lines. I'm limited in the size of the field due to my
>
application's layout, and I really don't want to change it.
>
>
Ideally, I'd like to use NSTextView for this field, but I can't find a
>
method for getting a string value from an NSTextView. Does such a method
>
exist? If not, does anybody know a way I can add a scroll bar into an
>
NSTextField? I've checked the foundation & app kit docs, but can't find
>
anything.
>
>
Thanks for any help you can give.
>
>
Mike Brinkman
>
>
>
--
>
The premiere source of Mike Brinkman related news on the internet!
>
http://www.mikebrinkman.com
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.