Re: NSOutlineView Table Column Clicks
Re: NSOutlineView Table Column Clicks
- Subject: Re: NSOutlineView Table Column Clicks
- From: Jordan Matthiesen <email@hidden>
- Date: Wed, 24 Oct 2001 11:27:18 -0700
That does work for mouseDown:, but I want the code to execute in the
mouseUp:. Sorry, I forgot to mention that. Thanks for the response!
Jordan
On Wednesday, October 24, 2001, at 11:21 AM, Nathan Schmidt wrote:
Set yourself up as the delegate for the outline view in awakeFromNib,
for
example:
[yourOutlineView setDelegate:yourObject];
[yourOutlineView setAllowsColumnSelection:YES];
Then add this to yourObject:
- (BOOL)outlineView:(NSOutlineView *)outlineView
shouldSelectTableColumn:(NSTableColumn *)tableColumn {
//do something useful here...
//accept click but never select (the normal behavior)
return NO;
}
I've been trying to tackle an issue for awhile now, and so far have had
no luck... I want to have some code execute in the mouse up of a column
header in an NSOutlineView. I see how to do this with an NSTableView,
but unfortunately the "tableView:didClickTableColumn:" method does not
get called for the outline view. I've tried creating a subclass of
NSTableHeaderCell and overriding the "trackMouse: inRect: ofView:
untilMouseUp:" method, but it does not execute the NSLog() statement I
put in it (I did instantiate an object from my subclass and associate
it
with one of the NSTableColumn objects in the OutlineView using
NSTableColumn setHeaderCell:). I thought this is what was recommended
to people trying similar things, but I can't seem to get it to work.
Does anyone have any ideas? Thanks!