Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 12, 2009, 01:04 PM   #1
tmeehan
macrumors newbie
 
Join Date: Feb 2009
How to change the highlight color of a row in a tableview

I need to be able to modify the behavior of my tableview. When I click on a row, i would like it to be selected but show now signs of being selected. I may in the future want to just draw a frame around the selected row - but for now I would just like it to do nothing. In other words I want to disable the blue highliting when a cell is clicked. The row does need to be selectable however because the cells are editable and one of the columns consists of NSPopUpButtonCells.

I have subclassed NSTableView and NSTableColumn.

Help with this would make my week! Thanks in advance.
tmeehan is offline   0 Reply With Quote
Old Mar 12, 2009, 10:02 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
See http://www.cocoadev.com/index.pl?AlternatingRowColors
kainjow is offline   0 Reply With Quote
Old Mar 13, 2009, 02:13 PM   #3
tmeehan
Thread Starter
macrumors newbie
 
Join Date: Feb 2009
Close but not quite there yet

Thanks for the link. It did provide a lot of insight into the whole issue. And I imagine that somewhere in there are critical pieces of the puzzle. I still can't control the highlighting on the non-text cells. For my simple test I just have one column of text and one column whose cells are NSPopUpButtonCells. I have subclassed NSTableColumn to deal with the popups and all that works great except for this highlighting issue.

I would love to get my head around the whole cycle that occurs from the time i click on a row until the time I release the mouse and observe the selected and highlighted row. ie seems like the mousedown event would kick things off. From there I am sure a whole chain of messages are sent from object to object in a very specific order. If I could find out exactly what is going on and in what order, I could probably track down exactly what method is doing the actual drawing of the highlight color. From there I assume I could code my way out of this situation.

I am all ears. Any help at all would help me cope. thanks
tmeehan is offline   0 Reply With Quote
Old Mar 13, 2009, 03:00 PM   #4
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Oops sorry I mixed up highlighting and alternating color

I believe you can override highlightSelectionInClipRect and draw what you want there to replace the color.
kainjow is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Possible to change 5s color? mjschabow iPhone 14 Apr 20, 2014 07:06 PM
ios7 tableView cell background color issue larswik iPhone/iPad Programming 11 Oct 6, 2013 01:37 PM
ios 7 menu highlight color dimdom iOS 7 2 Aug 9, 2013 04:56 PM
Animated row insertion in tableview jeanlain Mac Programming 0 Nov 27, 2012 04:59 PM
Change pointer color MacPC OS X 10.8 Mountain Lion 0 Aug 22, 2012 03:08 PM

Forum Jump

All times are GMT -5. The time now is 02:02 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC