Re: NSTextView: how to avoid insertion of text
Re: NSTextView: how to avoid insertion of text
- Subject: Re: NSTextView: how to avoid insertion of text
- From: Shawn Erickson <email@hidden>
- Date: Tue, 30 Apr 2002 19:47:50 -0700
How are you adding your text to the NSTextView?
The following seems to work...
@interface MyObject : NSObject
{
IBOutlet NSTextView *textView;
}
- (IBAction)addText:(id)sender;
- (IBAction)clearText:(id)sender;
@end
@implementation MyObject
- (IBAction)addText:(id)sender
{
[textView setString:[[textView string]
stringByAppendingString:@"This is some text\n"]];
}
- (IBAction)clearText:(id)sender
{
[textView setString:@""];
}
@end
-Shawn
On Tuesday, April 30, 2002, at 02:59 PM, Gilles Celli wrote:
Hi Shawn,
In IB (or programmatically) you can mark the view to not support
editing
(the "Editable" check box). This should block the user from modifying
things, including the insertion point.
Thanks for your advice but I even tried that and it doesn't work:
No text will then be displayed if uncheck "Editable" for NSTextView
In IB...
_______________________________________________
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.