Re: Custom NSPathControl
Re: Custom NSPathControl
- Subject: Re: Custom NSPathControl
- From: Corbin Dunn <email@hidden>
- Date: Wed, 05 May 2010 09:58:42 -0700
On May 5, 2010, at 4:20 AM, Graham Cox wrote:
> I have a UI that is designed to break down a huge collection of items into a manageable subset that the user can work with at a time. Each item effectively has a sort of "path", that describes its hierarchy, not in terms of its location on disk, which is irrelevant, but its place in the whole big collection of objects which is vaguely analogous to a file path.
>
> I was looking at NSPathControl as a way to neatly show which item was selected including its hierarchical information, but quickly realised that this control is very strongly tied to NSURLs as a specific form of path and was not designed to be readily abstracted.
It is tied to NSUrls, but it can easily be abstracted. Just use a non file URL. Or, explicitly control the pathComponentCells and fill them up with you what you want. You'll want to subclass NSPathCell, and NSPathComponentCell.
Override points:
+ (Class)pathComponentCellClass; (or, directly set the pathComponentCells)
- (NSRect)rectOfPathComponentCell:(NSPathComponentCell *)cell withFrame:(NSRect)frame inView:(NSView *)view;
>
> So is using NSPathControl even possible for this, or would I just be better off writing a complete new control from scratch? NSPathControl does some neat things like fading overlong text within a subcell that I could use, as well as displaying an icon and a triangle for the next item. What about subclassing the subcell? I guess I'm just looking for some direction here or even better, some code out there I can use.
It can work. If you have trouble, please do log bugs with issues you encounter. The goal was to make it flexible, but there is the possibility of issues, depending on "what you want to do"
corbin_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden