Switch button in NSTableView header
Switch button in NSTableView header
- Subject: Switch button in NSTableView header
- From: PGM <email@hidden>
- Date: Sat, 17 Jun 2006 14:09:47 +0200
Hey everyone,
My app has a NSTableView where the columns represent variables that can
be included or excluded from an analysis. I would like the user to be
able to set whether variables are included through a switch button in
the column's header. So far, I have been unable to find a satisfactory
way to include switch buttons in the tableView headers.
My first try was to replace the headerCell with NSButtonCell, but this
looked very bad and the state of the button was simply determined by
whether the column was selected or not, so not very useful for my
purpose.
I now have something that works, but with which I am quite unsatisfied.
I subclassed NSButtonCell to implement (some functions of) the
NSTextAttachmentCell protocol and used that subclass to place a button
inside an attributed string that I place in the headerCell. However,
the button becomes greyed out and does not respond to mouse clicks.
I was wondering whether anybody could give me any tips for another way
to implement this?
Many thanks in advance,
PGM
_______________________________________________
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