NSOutlineView: How does Cocoa determine a click in a cell can start a drag operation?
NSOutlineView: How does Cocoa determine a click in a cell can start a drag operation?
- Subject: NSOutlineView: How does Cocoa determine a click in a cell can start a drag operation?
- From: Stéphane Sudre <email@hidden>
- Date: Sun, 3 Feb 2008 13:55:06 +0100
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.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden