Re: Need guidance in table sorting
Re: Need guidance in table sorting
- Subject: Re: Need guidance in table sorting
- From: Yuhui <email@hidden>
- Date: Mon, 10 Mar 2003 02:15:32 -0600
Thanks for the reply. I have a few follow-up questions:
1. It seems that for each table column header, I have to use its
setAction: method (from the NSActionCell parent) to attach the sort
method to it at startup. Is this correct?
Sounds like it would work, but I haven't tried it. It's probably easier
to use the table's -tableView:didClickTableColumn: delegate message.
Where is the documentation for this method? I looked around
NSTableView, NSTableColumn and the "Table Views" programming topic, but
I coudn't find anything about this.
2. How do I put a little triangle indicator image in the header, like
those seen in Apple's apps (e.g. Mail, iTunes)? I know how to use
setIndicatorImage:inTableColumn, but where do I find the triangle
image itself? I searched the mailing list archives in Mamasam and
found that there used to be a method, [NSTableView
_defaultTableHeaderSortImage], to get the prebuilt image, but when I
tried it, PB said that there was no such method, so it seems that
this undocumented feature doesn't work any more.
On 10.2 you can get the images via:
[NSImage imageNamed:NSAscendingSortIndicator]
and
[NSImage imageNamed:NSDescendingSortIndicator]
This is documented in the AppKit release notes.
I'd actually read about this on Mamasam, but when I tried this again
after reading your email, i.e.
[myTable setIndicatorImage:[NSImage
imageNamed:NSAscendingSortIndicator] inTableColumn:[[myTable
tableColumns] objectAtIndex:0]];
I got an error saying that NSAscendingSortIndicator is undeclared. I
can't find any reference to NSAscendingSortIndicator in NSImage.h,
NSTableView.h, NSTableColumn.h, NSTableHeaderView.h or
NSTableHeaderCell.h.
Thanks again for your help!
Yuhui
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.