Kaunteya
Kaunteya

Reputation: 3090

Change NSTableView Header Font Color

How can I change font-size, color and other properties of NSTableHeaderView?

Someone has already answered the question here, but the accepted answer is outdated, since it is for cell based TableViews.

I am looking for a solution for view based NSTableView

Upvotes: 4

Views: 1559

Answers (1)

Marek H
Marek H

Reputation: 5576

Unfortunately view based column headers are still unsupported (I mean not using NSTableHeaderViewCell)

Just take a look into "NSTableColumn.h" and you will see that there is following property which has a "kindof" -> not possible to use NSView.

/* Gets and sets the headerCell associated with this NSTableColumn. 'cell' must be non nil, and should be a member of the

NSTableHeaderCell class. The 'headerCell' is a strong reference, and will be retained. */

@property (strong) __kindof NSTableHeaderCell *headerCell;

The only way to achieve what you need is to set properties on NSTableHeaderCell which is a subclass of "NSTextFieldCell".

Upvotes: 0

Related Questions