Re: textViewDidChangeSelection
Re: textViewDidChangeSelection
- Subject: Re: textViewDidChangeSelection
- From: John Anderson <email@hidden>
- Date: Wed, 19 Jun 2002 10:41:50 -0700
The result of selectedRange is an NSRange, which is a struct. It
contains two elements, a location and a length. So you can get the
length of the selection like this: [myTextView selectedRange].length
This will return an integer.
John Anderson
On Wednesday, June 19, 2002, at 10:28 AM, Jeremy Dronfield wrote:
I've got the following method which enables a button when text in a
TextView is selected:
- (void)textViewDidChangeSelection:(NSNotification *)aNotification
{
[[self markButton] setEnabled:YES];
}
It works, but I really want to know how to make it conditional, so
that if the text is deselected, markButton is disabled again. I've
messed about with various if's using selectedRange, but can't get
anything to work. The problem seems to be that I don't know how to
access selectedRange's length.
- Jeremy
_______________________________________________
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.
_______________________________________________
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.