Skip navigation.
 
mlRe: So whats the deal with NSBrowser?
FROM : Andreas Höschler
DATE : Sun Dec 12 22:55:37 2004

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

Related mailsAuthorDate
mlSo whats the deal with NSBrowser? Oliver Cameron Dec 12, 21:38
mlRe: So whats the deal with NSBrowser? Oliver Cameron Dec 12, 22:14
mlRe: So whats the deal with NSBrowser? Andreas Höschler Dec 12, 22:55