Get highlighted state for NSButtonCell
Posted
by
dvg
on Stack Overflow
See other posts from Stack Overflow
or by dvg
Published on 2012-09-30T12:58:55Z
Indexed on
2012/10/06
9:37 UTC
Read the original article
Hit count: 220
I have a NSTableView
that contains a NSButtonCell
in one of the columns. To draw a custom background in neighbor cells (based on NSTextFieldCell
) I use isHighlighted
method:
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
if ([self isHighlighted]) {
//here I draw the cell background
But for NSButtonCell
isHighlighted
shows only the button pressed state.
How to determine when the NSButtonCell
is selected, i.e. when it's highlighted in the row?
© Stack Overflow or respective owner