Re: NSTextView - firstResponder notification?
Re: NSTextView - firstResponder notification?
- Subject: Re: NSTextView - firstResponder notification?
- From: "Jordan Krushen" <email@hidden>
- Date: Fri, 17 Mar 2006 16:51:12 -0800
On 3/17/06, Mike Abdullah <email@hidden> wrote:
> Out of interest (seeing as it wasn't me who asked the question), why do you
> use performSelector:withObject:afterDelay in this case?
> On 18 Mar 2006, at 00:20, Jordan Krushen wrote:
> [self performSelector:@selector(selectAll:) withObject:self afterDelay:0];
I slapped together a quick test, and if I just did [self
selectAll:self], it would only select the text upon tabbing into the
view, not if you clicked into it. The OP asked for tab entry as well
as clicking; this seems to make it work more consistently.
It would seem that the reason for this is that the first responder
checks come before the click event makes it to the cursor-handling
part of the view, so that it would select the text, but the view would
de-select it immediately and just put the cursor where you clicked.
With the delayed action, the click makes it to the text view, which
puts the cursor where you clicked, and after that, the selectAll:
message comes through, selecting all the text.
J.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden