 |
 |
NSTableHeaderCell
|
 |
|
 |
|
Junior Member
Join Date: Mar 2001
Status:
Offline
|
|
Does anyone know how I would coax an NSTableHeaderCell to draw itself with a blue/graphite appearance (as if it were the selected column in a table view)?
No combination of setState, setHighlighted nor setEnabled seems to change the appearance the way I want.
Thanks,
Dave
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Use -highlightWithFrame:inView: instead of -drawWithFrame:inView:, IIRC.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Oct 2001
Status:
Offline
|
|
Im thinking I dont understand the question 'cuz the following works for me:
[tableView setHighlightedTableColumn: tableColumn];
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Mar 2001
Status:
Offline
|
|
3R1C, I'm trying to use the NSHeaderCell on its own, not part of any NSTableView in particular.
Rickster, your suggestion didn't seem to work. As far as I can tell, highlightWithFrame seems to produce the result as drawWithFrame.
Anyways, it's not essential, but it'd be nice to crack this nut.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status:
Offline
|
|
Maybe -highlight:withFrame:inView: ?
(inherited from NSCell, but it seems to be overridden in NSTableHeaderCell)
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Ah, posted the wrong method signature from memory since I didn't have the code handy.  Here's the correct version, straight from a view I wrote recently that does exactly what you're talking about :
Code:
if ([[self window] isKeyWindow])
[cell highlight:YES withFrame:cellRect inView:self];
else
[cell drawWithFrame:cellRect inView:self];
Also, it'll only work if the current graphics context (i.e. the view you locked focus on) actually belongs to the current key window -- it won't work drawing into a cached NSImage, for example.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|