• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: So whats the deal with NSBrowser?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: So whats the deal with NSBrowser? (From: Oliver Cameron <email@hidden>)

  • Prev by Date: Re: So whats the deal with NSBrowser?
  • Next by Date: RE: How can I implement labels without the overhead of an NSTextField?
  • Previous by thread: Re: So whats the deal with NSBrowser?
  • Next by thread: Layered views and drawRect
  • Index(es):
    • Date
    • Thread