Re: Question about Outline View code in Documentation
Re: Question about Outline View code in Documentation
- Subject: Re: Question about Outline View code in Documentation
- From: James McConnell <email@hidden>
- Date: Fri, 06 Feb 2004 22:15:03 -0600
On 2/6/04 9:49 PM, "mmalcolm crawford" <email@hidden> wrote:
>
On Feb 6, 2004, at 7:15 PM, James McConnell wrote:
>
>
> Greetings, all. In /Developer/Examples/AppKit/Outline View, the
>
> project has
>
> a file for FileSystemItem, representing a file system item.
>
> [...]
>
> By default, it is set at "/". I would like this set to
>
> "/Users/myuseraccount/Documents/folder", where "myuseraccount" is the
>
> account this app will be running under
>
>
One way (though you're left with the full path displayed at the root --
>
you could do this more elegantly):
>
>
To FileSystemItem.h add:
>
>
- (void)setRelativePath:(NSString *)newRelativePath;
>
>
>
To FileSystemItem.m add:
>
>
- (void)setRelativePath:(NSString *)newRelativePath {
>
[relativePath autorelease];
>
relativePath = [newRelativePath copy];
>
}
>
>
Then replace:
>
>
- (id)initWithPath:(NSString *)path parent:(FileSystemItem *)obj {
>
if (self = [super init]) {
>
[self setRelativePath:[path lastPathComponent]];
>
parent = obj;
>
}
>
return self;
>
}
>
>
+ (FileSystemItem *)rootItem {
>
if (rootItem == nil)
>
{
>
NSString *rootPath = NSHomeDirectory();
>
rootItem = [[FileSystemItem alloc] initWithPath:rootPath
>
parent:nil];
>
[rootItem setRelativePath:rootPath];
>
}
>
return rootItem;
>
}
>
>
>
mmalc
>
_______________________________________________
>
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.
I think I can work with that, thanks! I can get the home directory, then
append "/Documents/Folder". Any clue as to how I can get it not to show
hidden, "." files? Or is that in the documentation on Outline View I'm not
seeing? Thanks a lot!
_______________________________________________
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.