outlineview meets button
outlineview meets button
- Subject: outlineview meets button
- From: Eric Cole <email@hidden>
- Date: Tue, 6 May 2003 17:16:31 -0700
How can you disable the selection of an NSOutlineView item without
disabling the tracking of the mouse click? I have a switch button in
one column of the view, and do not want any cells to be selectable.
When the selection for a cell is disabled the switch button is never
tracked.
By disabling the selection, I mean returning NO from the
shouldSelectItem delegate method. And the switch button is an
NSButtonCell.
The easiest way to do this seemed to be not drawing the selection, but
that turns out to be impossible.
I have tried setting the cell attributes of various cells to not draw
the background, but that had no discernible effect. This from various
delegate and subclass methods.
I have tried overriding highlightSelectionInClipRect but that only
affects the highlight between the cells.
The other way to do it seemed to be to manually track the cell.
I have tried setting the action and target of the outline view and
calling performClick on the cell from the handler. No tracking occurs
but the click does effect the cell, and the next time the table is
drawn the change is apparent.
I have also tried calling trackMouse instead of performClick but the
effect is the same.
I have tried a few other variants without any success. Any suggestions
are welcome.
On a side note, the checkbox does not track like a checkbox. Clicking
in a box then dragging the mouse down to another row begins tracking
the box in the new row, leaving the original box unchanged. This is
acceptable, but it would be better if the check box acted like a check
box.
Thank you
Eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.