• 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
NSOutlineView - How to hide disclosure triangle for root nodes ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOutlineView - How to hide disclosure triangle for root nodes ?


  • Subject: NSOutlineView - How to hide disclosure triangle for root nodes ?
  • From: Mario Kušnjer <email@hidden>
  • Date: Wed, 25 Nov 2009 14:49:37 +0100

Hello to all on the list.

I have a little question so if anyone could help me.
I'm have an outline view that has one (for now) object in root array that acts as a root from which all other objects derives.


\/ Root Array
 |----------------\/ Root object
                        |----------------- Child 1
                        |----------------- Child 2
                        |--------------- \/ Child 3
                                               |----------- Child 3.1
                                               |----------- Child 3.2
                        |----------------- Child 4

My question is:
How to hide the disclosure triangle in front of the Root object and remove indentation for it, and just that object (and later if there is more Root objects for them too) ?


\/ Root Array
 |---------------- Root object
                        |----------------- Child 1
                        |----------------- Child 2
                        |--------------- \/ Child 3
                                               |----------- Child 3.1
                                               |----------- Child 3.2
                        |----------------- Child 4

I would like it too look like source list in Apple's Mail application - where it says - MAILBOXES.

I found the delegate method which is used for drawing outlineCell
- (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn: (NSTableColumn*)tableColumn item:(id)item


but that method does not get called if Root object is empty.

There is a method that is also used for drawing outlineCell
- (NSRect)frameOfOutlineCellAtRow:(NSInteger)row

but it is not a delegate method which means that I should subclass NSOutlineView to implement that behavior.

I'm trying to make it work with the delegate method (that would be my preferred way) but I can't make it work.
Any suggestions what to do ? And how ?


There is a zip archive of my project at http://www.box.net/crowebster-public so anyone interested can download it to review my work.

P.S. additional question:

If there is number of object that are identical (just added to the array but not yet modified), when one item is selected and removeItem method is called upon it,
all identical objects are removed instead just selected object.


How to avoid that behavior (the simplest possible way) ?

Notice: All objects are instances of NSMutableDictionary.

That problem is also in the same project.

Any suggestions are appreciated.
Thanks in advance. Bye.


Mario Kušnjer email@hidden +385957051982



_______________________________________________

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


  • Follow-Ups:
    • Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Custom drawing in IKImageBrowserView fails
  • Next by Date: Re: Custom drawing in IKImageBrowserView fails
  • Previous by thread: Re: Custom drawing in IKImageBrowserView fails
  • Next by thread: Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
  • Index(es):
    • Date
    • Thread