Suppressing highlight drawing in an NSTableView
Suppressing highlight drawing in an NSTableView
- Subject: Suppressing highlight drawing in an NSTableView
- From: Greg Hurrell <email@hidden>
- Date: Thu, 11 May 2006 14:44:44 +0200
I have an NSTableView which supports re-ording of rows via drag-and-
drop, but for special reasons I do not want to draw highlighting for
selected rows.
If I make the rows unselectable I break the drag-and-drop, so I have
to find a way to allow selection of rows but suppress the drawing of
their highlights. Anyone know how this can be done?
I've tried various things:
- doing a setHighlightsBy:NSNoCellMask on the cells (no effect)
- using a custom NSTableView subclass that overrides the
highlightSelectionInClipRect: method, making it a no-op (only
suppresses highlighting of the gridlines in the table view)
- using custom cells and overriding the setHighlighted: method (this
method doesn't seem to get called when highlighting a row, only when
clicking no something inside the cell)
- same for overriding highlight:withFrame:inView: (doesn't get called
when highlighting a row)
- overriding the cells drawInteriorWithFrame:inView: method (contrary
to the docs, doesn't seem to get called)
- overriding the cells drawWithFrame:inView: (this method *does* get
called, but I don't want to go through the painful and error-prone
process of re-implementing from scratch the cell-drawing code, I
merely want to modify its behaviour...)
Any suggestions?
Cheers,
Greg
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden