• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Suppressing highlight drawing in an NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Suppressing highlight drawing in an NSTableView
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Subviews becoming blurry or "chopped up"
  • Next by Date: Re: How to receive events fro NSColorWell
  • Previous by thread: Re: NSSpellServer problem (``Couldn\'t contact Spell Server\'\')
  • Next by thread: Re: Suppressing highlight drawing in an NSTableView
  • Index(es):
    • Date
    • Thread