[comp.sys.next] Why must Window do a makeFirstResponder: before sending a mouseDown?

mikem@uhccux.uhcc.Hawaii.Edu (Mike Morton) (05/22/91)

Before a Window dispatches a mouse-down to the receiving View, it
usually makes that View the first responder.  I want to prevent it
from doing so.  Any ideas?  I'm hoping there's some way to inhibit
this, since experimentation suggests that a Window is smart enough
to avoid this behavior when the click is done with the Shift key
down.

Why do I want to do this?  I'm trying to implement a View subclass
which selects on a click, then shows a different kind of selection
on a second click -- not necessarily a double-click.  (Think of a
piece of text which gets handles on one click, then an insertion
point with a second.)

A first click selects the object with no problem, and it becomes
the first responder (by the Window's efforts, or by its own).

After the second click, the Window tries to make the view the
first responder again.  It thus sends (indirectly) a resignFirst-
Responder message to the view.  The view thinks it's been deselected,
winding up as if the first click had never come in.  Then when the
mouse-down finally gets sent to the view, it thinks it's a first click.

(I'm simplifying a little bit here.  The second click is in a
subview of the view, if it matters.)

So, why must the Window make views the first responder?  Doing so
can lose information the view may want to use when handling the
mouseDown.  Any comments?

 -- Mike Morton // P.O. Box 11299, Honolulu, HI  96828, (808) 676-6966 HST
      Internet: mikem@uhccux.uhcc.hawaii.edu
    (anagrams): Mr. Machine Tool; Ethical Mormon; Chosen Immortal; etc.