• 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
Re: NSTextView: how to avoid insertion of text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Notification problem
  • Next by Date: [ANN] RRSpreadSheet BOF release
  • Previous by thread: Re: NSTextView: how to avoid insertion of text
  • Next by thread: Using NSImage in command line tool
  • Index(es):
    • Date
    • Thread