NSTableView - double click

  • I have asked this before but the post kind of got lost.

    How do I detect a double click on an item in a TableView?  I could
    measure the time between the current click and the previous click on an
    item but that seems a bit ugly.  Also, ideally the threshold for a
    double-click would be the same as the one defined in System Prefs but I
    don't know how I'd arrange that.

    I know this must be possible so help would be much appreciated,

    Colin
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • Use the list archives at:

    <http://cocoa.mamasam.com/>

    j o a r

    On Thursday, Jan 23, 2003, at 15:00 Europe/Stockholm, Colin Jackson
    wrote:

    > I have asked this before but the post kind of got lost.
    >
    > How do I detect a double click on an item in a TableView?  I could
    > measure the time between the current click and the previous click on
    > an item but that seems a bit ugly.  Also, ideally the threshold for a
    > double-click would be the same as the one defined in System Prefs but
    > I don't know how I'd arrange that.
    >
    > I know this must be possible so help would be much appreciated,
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Thursday, January 23, 2003, at 03:00  PM, Colin Jackson wrote:

    > I have asked this before but the post kind of got lost.
    >
    > How do I detect a double click on an item in a TableView?

    Use the following NSTableView method: - (void) setDoubleAction: (SEL)
    aSelector

    For example:

    NSTableView* myTableView...

    [myTableView setDoubleAction: @selector(doubleAction:)];
    [myTableView setTarget: self];

    - (void)doubleAction:(id)sender
    {
    NSLog(@"Double click was detected...");
    }

    I hope this helps,

    -- Tito
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
previous month january 2003 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today