Re: Double-click action in an NSOutlineView
Re: Double-click action in an NSOutlineView
- Subject: Re: Double-click action in an NSOutlineView
- From: Quentin Mathé <email@hidden>
- Date: Wed, 15 Jan 2003 03:05:23 +0100
Le mardi, 14 jan 2003, ` 23:53 Europe/Paris, Jean-Francois Roy a icrit :
Hello.
I am new to Cocoa and I am trying to do the a file browser using a
NSOutlineView (not to browse the filesystem, but rather a compressed
archive).
I am using the ImageAndTextCell subclass Apple wrote in their
DragNDropOutlineView example (AppKit examples).
It works great, except that instead of editing the name when
double-clicking on a group item, I would like it to perform some
selector that would reload the content of the view so that the root
item is now the double-clicked group (like the Finder basically). Then
of course the question of how to provide editing capabilities to group
items begs itself.
I think you need to use the following delegate method :
outlineView:shouldEditTableColumn:item:
like that
- (BOOL)outlineView:(NSOutlineView *)outlineView
shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item {
if ([outlineView isExpandable:item] && [[tableColumn identifier]
isEqual:@"theFirstTableColumn"]) {
return NO;
}
else {
return YES;
}
}
And you can use setDoubleAction: and setTarget to initialize you
outline view in order to handle the double-click
--
Quentin Mathi
email@hidden
_______________________________________________
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.