Re: Sorting columns of non-reorderable columns tableview
Re: Sorting columns of non-reorderable columns tableview
- Subject: Re: Sorting columns of non-reorderable columns tableview
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 7 Sep 2001 11:39:18 +0200
On jeudi, septembre 6, 2001, at 08:11 PM, John Hansen wrote:
Help...
[crunch]
Nothing in the following answer is from my brain, I just have copy it in
Stickies and use it but don't remember the original author name (so
credits go to these persons):
First step: retrieve the Triangle tiff
-----------
[[[NSTableView _defaultTableHeaderSortImage]
TIFFRepresentation]
writeToFile: @"/temp/down_arrow.tiff"
atomically: YES];
[[[NSTableView _defaultTableHeaderReverseSortImage]
TIFFRepresentation]
writeToFile: @"/temp/up_arrow.tiff"
atomically: YES];
Second Step: Implement the delegate method
tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn
*)tableColumn
------------
- (void) tableView:(NSTableView*)tableView
didClickTableColumn:(NSTableColumn *)tableColumn
{
// check to see if this column was already the selected one and if
so invert the sort function.
if ([currentSortedColumn_ isEqualToString:[tableColumn
identifier]]==YES)
{
}
else
{
// if there already was a sorted column, remove the indicator
image from it.
}
// set the indicator image in the newly selected column
// set the highlighted table column.
// Sort
}