Re: Double click in NSTableView
Re: Double click in NSTableView
- Subject: Re: Double click in NSTableView
- From: David Remahl <email@hidden>
- Date: Thu, 12 Dec 2002 09:33:56 +0100
Eric,
Although I haven't implemented it in practice, I think the following
method would work OK:
- (IBAction)tableSingleClickAction:(id)sender
{
[self performSelector:@selector(performSingleClickAction)
withObject:sender afterDelay:GetDblTime() / 60.0]; // carbon call,
couldn't find cocoa version. Create a category?
}
- (IBAction)tableDoubleClickAction:(id)sender
{
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(performSingleClickAction) object:sender];
[self performDoubleClickAction:sender];
}
- (void)performSingleClickAction:(id)sender {...}
- (void)performDoubleClickAction:(id)sender {...}
/ Regards, David Remahl
On Thursday, December 12, 2002, at 08:16 AM, Eric Wang wrote:
I have a table view that needs to send an action on a single-click and
a
different action on a double-click. Currently, I'm using the table
view's
-setAction: and -setDoubleAction: methods in order to implement this,
but
this has the unwanted side effect of sending both actions when the user
double-clicks.
Essentially, I'm looking for behavior similar to that of
ProjectBuilder's
Groups & Files table view. If you single-click on a file, the file
contents
are displayed in the current window (The single-click action).
However, if
you double-click on a file, the file contents are displayed in a new
window
(The double-click action) without affecting the contents of the current
window (i.e. The single-click action was not sent).
Any ideas on how I might go about implementing this?
Eric Wang
_______________________________________________
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.