NSOutlineView: How does Cocoa determine a click in a cell can start a drag operation?

  • Question:
    ---------

    How does Cocoa determine a click in a cell can start a drag operation?

    And how can I tell it to allow a NSButtonCell can be clicked to start
    a drag operation?

    Problem:
    --------

    I have a NSOutlineView with 3 columns. The first column has its data
    cell to a subclass of NSButtonCell to display a checkbox (with a label)

    +--------------------+-----------+-----------+
    | [ ] My checkbox    | My Label  | My Label  |
    | [ ] My checkbox    | My Label  | My Label  |
    +--------------------+-----------+-----------+

    All the columns and data cells are set to be non editable.

    The subclass of NSButtonCell overloads - (BOOL)
    trackMouse:inRect:ofView:untilMouseUp: so that the cell does not
    respond to clicks.

    Now this doesn't seem to be enough as a click on a cell of the first
    column can not start a drag operation.

    If I disabled the cell, a click can start the drag operation.

    Current Investigation Results:
    ------------------------------

    - Mailing list archives: nothing relevant

    - Google: nothing obviously relevant

    - GNUStep source code: Apparently, returning NO for - (BOOL)
    trackMouse:inRect:ofView:untilMouseUp: should be enough.

    - Medium: overloading - (BOOL) trackMouse:inRect:ofView:untilMouseUp:
    is apparently enough for an Apple tool.

    - Advanced Medium: Provided a potential solution involving an API
    from the NeXT world.