Re: So whats the deal with NSBrowser?
Re: So whats the deal with NSBrowser?
- Subject: Re: So whats the deal with NSBrowser?
- From: Andreas Höschler <email@hidden>
- Date: Sun, 12 Dec 2004 22:55:37 +0100
Hi,
This kinda works, but basically all it does is add an object to the
NSBrowser titled Hello, and basically, it adds an infinite number of
items exactly the same within the root Hello item.
A SnippetsObject is basically a NSObject subclass which just holds
details for each instance of it, like its title and contents.
snippetObject is basically like my root, I add every new
SnippetsObject to that. So basically, what I want, is that every
parent should contain all its children in a different column.
I'm confused as to how I would go about doing that.
Make use of the parameter row and column passed to
- (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell
atRow:(int)row column:(int)column
Moreover you need to return a differnet number of rows for the given
column in
- (int)browser:(NSBrowser *)sender numberOfRowsInColumn:(int)column
e.g.
if (column == 0)
return [snippetObject count];
else if (column == 1)
return [snippetObject itemAtIndex: column] numberOfLeaves];
else return 0;
And make use of [cell setLeaf:NO]; in
- (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell
atRow:(int)row column:(int)column
Regards,
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden