NSOutlineView setDoubleAction: working on 10.5, but not on 10.4.11

  • Hi,
    when double clicking on an item the action method is not being called
    in 10.4.11.
    While the Apple docs say it is "Available in Mac OS X v10.0 and later."
    Is there something I may be missing.
    Its working fine on Leopard.

    Thanks,
    Nick
  • On 2008 Nov, 15, at 2:54, Nick Rogers wrote:

    > when double clicking on an item the action method is not being
    > called in 10.4.11.
    > Its working fine on Leopard.

    The behavior was indeed changed in Leopard:

    http://developer.apple.com/releasenotes/Cocoa/AppKit.html

    "NSTableView/NSOutlineView - Single click to editNSTableView and
    NSOutlineView now behave like Finder and allow a single click to put
    it into edit mode. This is done by calling -
    hitTestForEvent:inRect:ofView: and checking if the cell returns
    NSCellHitEditableTextArea. This allows you to set a doubleAction and
    perform some different task when the doubleAction is invoked (for
    instance, Finder opens files on a double click, and edits via a single
    click). If the doubleAction is not set, editing is still allowed via a
    double click."

    The converse of this statement would be that, in 10.4.11,
    doubleclicking will always edit.

    Personally, I believe this should be explained in the current
    documentation, but I've seen other cases in which Apple documents
    version-specific behavior changes in Release Notes only.  I don't know
    if that is intentional Apple policy or a bug.
  • Le Nov 15, 2008 à 5:54 AM, Jerry Krinock a écrit :

    >
    > On 2008 Nov, 15, at 2:54, Nick Rogers wrote:
    >
    >> when double clicking on an item the action method is not being
    >> called in 10.4.11.
    >> Its working fine on Leopard.
    >
    > The behavior was indeed changed in Leopard:
    >
    > http://developer.apple.com/releasenotes/Cocoa/AppKit.html
    >
    > "NSTableView/NSOutlineView - Single click to editNSTableView and
    > NSOutlineView now behave like Finder and allow a single click to put
    > it into edit mode. This is done by calling -
    > hitTestForEvent:inRect:ofView: and checking if the cell returns
    > NSCellHitEditableTextArea. This allows you to set a doubleAction and
    > perform some different task when the doubleAction is invoked (for
    > instance, Finder opens files on a double click, and edits via a
    > single click). If the doubleAction is not set, editing is still
    > allowed via a double click."
    >
    > The converse of this statement would be that, in 10.4.11,
    > doubleclicking will always edit.
    >
    > Personally, I believe this should be explained in the current
    > documentation, but I've seen other cases in which Apple documents
    > version-specific behavior changes in Release Notes only.  I don't
    > know if that is intentional Apple policy or a bug.
    >

    Please do log a bug requesting that we clarify this in the
    documentation.

    Nick -- the -doubleAction will work -- you just have to make sure the
    cell isn't editable. If you do want to allow the text in it to be
    edited, then you may be out of luck, since double click means "start
    editing". There are ways around it, but it involves a bit of
    subclassing and processing things differently depending on where the
    user double clicks.

    corbin
previous month november 2008 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
Go to today
MindNode
MindNode offered a free license !