FROM : Stéphane Sudre
DATE : Sun Feb 03 17:33:40 2008
Question:
---------
How does Cocoa determine a click in a cell can start a drag operation?
And how can I tell it to allow that 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.
P.S:
Sorry for the repost but the mailing server did not seem to have
taken into account this post at the time of this reposting.
DATE : Sun Feb 03 17:33:40 2008
Question:
---------
How does Cocoa determine a click in a cell can start a drag operation?
And how can I tell it to allow that 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.
P.S:
Sorry for the repost but the mailing server did not seem to have
taken into account this post at the time of this reposting.
| Related mails | Author | Date |
|---|---|---|
| Stéphane Sudre | Feb 3, 17:33 | |
| Benjamin Stiglitz | Feb 6, 19:26 |






Cocoa mail archive

