• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView setDoubleAction/NSControl setAction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView setDoubleAction/NSControl setAction


  • Subject: Re: NSTableView setDoubleAction/NSControl setAction
  • From: Gerben Wierda <email@hidden>
  • Date: Wed, 7 Aug 2002 12:21:11 +0200

On Wednesday, August 7, 2002, at 11:51 , Angela Brett wrote:

I find this hard to believe. Because it means in effect that I have to implement my own 'turn two single clicks into a double click'. Done correctly I should get the user's mouse settings from somewhere. It is all very non-OO. The delay looks more like having to find and load the information to me. This click/doubleclick stuff is very deep inside the frameworks (NSEvent), it is completely unbelievable I should have to implement this at the app level.

Well, the frameworks are not psychic... how can they know whether the user is going to click again? The only way for NSEvent to do it for you is if it always waited a while before sending the single click action, and that would make things slower and also a bit more complicated in the many cases where the first click of a doubleclick does do the same thing as a single click.

Have a look at David Martin's reply:

If you override -[NSResponder mouseDown:] with something like that:

- (void)mouseDown:(NSEvent *)event {
NSLog(@"mouseDown: %d", [event clickCount]);
}

You'll see a single line with a clickCount of 1 for a single click, and two lines, first with a clickCount of 1, then a clickCount of 2 for a double click.

In other words, as I said: at the lowest level, an Event comes *with* knowledge about it being double/single click. That has nothing to do with being psychic, but with the fact that these action have been abstracted (we are in an OO-environment after all and not in Windows 3.1).

I see a faint possibility of some complicated (and non-OO) behaviour here, but that doesn't change that a setDoubleAction for NSTableView next to an already available setAction (in NSControl) only really makes sense from an OO-perspective if they are disjunct.

Can someone from Apple shed some light here?

G
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSTableView setDoubleAction/NSControl setAction
      • From: Nicholas Riley <email@hidden>
References: 
 >Re: NSTableView setDoubleAction/NSControl setAction (From: Angela Brett <email@hidden>)

  • Prev by Date: Re: enough of accessors - how about private method naming conventions in the real world?
  • Next by Date: Fwd: NSTableView setDoubleAction/NSControl setAction
  • Previous by thread: Re: NSTableView setDoubleAction/NSControl setAction
  • Next by thread: Re: NSTableView setDoubleAction/NSControl setAction
  • Index(es):
    • Date
    • Thread