Re: Clearing an NSTextView
Re: Clearing an NSTextView
- Subject: Re: Clearing an NSTextView
- From: Jeremy <email@hidden>
- Date: Sun, 24 Feb 2008 15:34:58 -0500
IS,
Thanks for the setString:. I believe I tried that before and it didn't
work. It is now working as intended.
Jeremy
"For a long time it puzzled me how something so expensive, so leading
edge, could be so useless, and then it occurred to me that a computer
is a stupid machine with the ability to do incredibly smart things,
while computer programmers are smart people with the ability to do
incredibly stupid things. They are, in short, a perfect match." - Bill
Bryson
On Feb 24, 2008, at 3:30 PM, I. Savant wrote:
I knew insertText: wouldn't remove the text. I just can't figure
out how to remove it all.
Did you read my previous e-mail? See also the e-mail from Gary. The
approach you take depends on whether you're using any attributes
(formatting). If it's all the same font/size/etc. then setString:
will do just fine ... just set it to:
@"";
... and it's empty.
And how do I select all of characters? That would be my only
problem with the replaceCharactersInRange:withString:...
-setSelectedRange:?
--
I.S.
On Feb 24, 2008, at 3:23 PM, Jeremy wrote:
I.S.,
I knew insertText: wouldn't remove the text. I just can't figure
out how to remove it all. And how do I select all of characters?
That would be my only problem with the
replaceCharactersInRange:withString:...
Thanks,
Jeremy
"For a long time it puzzled me how something so expensive, so
leading edge, could be so useless, and then it occurred to me that
a computer is a stupid machine with the ability to do incredibly
smart things, while computer programmers are smart people with the
ability to do incredibly stupid things. They are, in short, a
perfect match." - Bill Bryson
On Feb 24, 2008, at 3:20 PM, I. Savant wrote:
When I use [NSTextView insertText:@"Lyrics Code Here"];, it
doesn't delete the current text so that is it is replaced for the
user...
Why would you believe "insert" means anything but? If you read the
documentation on the text system, you'll get a better idea of
where to look for more answers.
You can ask the text view for its NSTextStorage (which is a
subclass of NSMutableAttributedString) and replace the contents
with -replaceCharactersInRange:withString: or -
replaceCharactersInRange:withAttributedString:
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden