Re: NSTextView
Re: NSTextView
- Subject: Re: NSTextView
- From: "John C. Randolph" <email@hidden>
- Date: Sat, 25 Aug 2001 13:46:47 -0700
On Saturday, August 25, 2001, at 09:54 AM, Johan Lindberg wrote:
-- Humm... You've probably gotten this question before, but since I
just joined this list, you're gonna get it again, whether you like it
or not.
How do I put text, programatically, in a NSTextView? I've looked
everywhere for a method to do this, but I haven't found any. I want to
make a log window, and I need to be able to append strings to it....
Appending text is the same as inserting text, so you can use a category
to add an append method like this:
@implementation NSText(appendString)
- (void) appendString:(NSString *) sString
{
[self replaceCharactersInRange:NSMakeRange([[self string] length],0)
withString:stringToAppend];
}
@end
And then just send -appendString: messages to your NSTextView whenever
you have something to append.
-jcr
Support your right to protest a criminal nut-cult.
http://freehenson.da.ru/
References: | |
| >NSTextView (From: Johan Lindberg <email@hidden>) |