Do NSSearchFields really send an action up the responder chain when the user clicks the cancel button?

  • According to this page:

    http://developer.apple.com/documentation/Cocoa/Conceptual/SearchFields/Arti
    cles/ConfiguringTargetAction.html


    Search fields also generate a secondary action message, one intended
    to cancel the current search. When a user clicks the cancel button,
    the action message is sent up the responder chain to the first object
    that handles it. This object deletes the contents of the search field
    and activates the control. It also checks for an empty string value,
    which indicates that the search should be stopped.

    That's nice and all, but is it really true? Do I need to set the
    action sent up the responder chain? What's the default?

    AndyT (lordpixel - the cat who walks through walls)
    A little bigger on the inside

    (see you later space cowboy, you can't take the sky from me)
  • Hi Andrew,

    Hm, the docs make this sound more special than it really is.  I'll file a bug.

    The cancel button acts the same as the user selecting the text in the
    field and deleting it.  The usual action message is sent in the usual
    way, and the stringValue of the control will be @"".

    Ken Ferry
    Cocoa Frameworks

    On Dec 24, 2007 11:19 AM, Andrew Thompson <lordpixel...> wrote:
    > According to this page:
    >
    > http://developer.apple.com/documentation/Cocoa/Conceptual/SearchFields/Arti
    cles/ConfiguringTargetAction.html

    >
    > Search fields also generate a secondary action message, one intended
    > to cancel the current search. When a user clicks the cancel button,
    > the action message is sent up the responder chain to the first object
    > that handles it. This object deletes the contents of the search field
    > and activates the control. It also checks for an empty string value,
    > which indicates that the search should be stopped.
    >
    >
    > That's nice and all, but is it really true? Do I need to set the
    > action sent up the responder chain? What's the default?
    >
    >
    > AndyT (lordpixel - the cat who walks through walls)
    > A little bigger on the inside
    >
    > (see you later space cowboy, you can't take the sky from me)
    >
  • Right. I little time in the debugger and I answered my own question.

    The description makes it sound more like NSFontManager's changeFont,
    whereas its really much simpler :)

    Thanks,

    AndyT

    On Dec 24, 2007, at 5:51 PM, Ken Ferry wrote:

    > Hi Andrew,
    >
    > Hm, the docs make this sound more special than it really is.  I'll
    > file a bug.
    >
    > The cancel button acts the same as the user selecting the text in the
    > field and deleting it.  The usual action message is sent in the usual
    > way, and the stringValue of the control will be @"".
    >
    > Ken Ferry
    > Cocoa Frameworks
    >
    > On Dec 24, 2007 11:19 AM, Andrew Thompson <lordpixel...> wrote:
    >> According to this page:
    >>
    >> http://developer.apple.com/documentation/Cocoa/Conceptual/SearchFields/Arti
    cles/ConfiguringTargetAction.html

    >>
    >> Search fields also generate a secondary action message, one intended
    >> to cancel the current search. When a user clicks the cancel button,
    >> the action message is sent up the responder chain to the first object
    >> that handles it. This object deletes the contents of the search field
    >> and activates the control. It also checks for an empty string value,
    >> which indicates that the search should be stopped.
    >>
    >>
    >> That's nice and all, but is it really true? Do I need to set the
    >> action sent up the responder chain? What's the default?
    >>
    >>
    >> AndyT (lordpixel - the cat who walks through walls)
    >> A little bigger on the inside
    >>
    >> (see you later space cowboy, you can't take the sky from me)
    >>

    AndyT (lordpixel - the cat who walks through walls)
    A little bigger on the inside

    (see you later space cowboy, you can't take the sky from me)
previous month december 2007 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