• 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: Hiding NSButtonCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding NSButtonCell


  • Subject: Re: Hiding NSButtonCell
  • From: Rainer Standke <email@hidden>
  • Date: Tue, 6 Jul 2010 10:06:40 -0700

Thanks for your help, Graham, that now makes more sense. I am actually using 'isLeaf' on item to determine if it's a parent or not...

Rainer

On Jul 5, 2010, at 17:11 , Graham Cox wrote:

>
> On 06/07/2010, at 4:56 AM, Rainer Standke wrote:
>
>> setEnabled works on single cells, and as expected: the outline row's button is grayed out. Oddly, setTransparent affects all cells in the column, i.e. the button appears in no row, not even the ones that have no children.
>>
>> That's confusingly inconsistent, to me. What should I do to make invisible only the checkboxes in the row that have a twirly triangle?
>
>
> There is only one cell, reused for each row in the column as needed.
>
> Therefore you not only need to disable the cell/make it transparent, but set the opposite state for all other rows, otherwise it just remains in the last state you set.
>
> If you just want to hide it for 'parent' items, this method can also refer to the other delegate method - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item. Presumably your controller/data model can determine which items are parent items since the outline view is told this information by you:
>
>
> - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
> {
> 	if ( [[tableColumn identifier] isEqualToString:@"toReconnect"] )
> 	{
> 		[cell setEnabled:![self outlineView:outlineView isGroupItem:item]];
> 		[cell setTransparent:[self outlineView:outlineView isGroupItem:item]];
> 	}
> }
>
> --Graham
>
>
>
>

_______________________________________________

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

References: 
 >Hiding NSButtonCell (From: Rainer Standke <email@hidden>)
 >Re: Hiding NSButtonCell (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSWorkspace iconForFile
  • Next by Date: Re: How to debug crash on startup of 64-bit build
  • Previous by thread: Re: Hiding NSButtonCell
  • Next by thread: UITableView.layer renderInContext: after setContentOffset ?
  • Index(es):
    • Date
    • Thread