• 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: How to set checkbox state in TableView columnheader
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set checkbox state in TableView columnheader


  • Subject: Re: How to set checkbox state in TableView columnheader
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 9 Oct 2009 13:01:53 -0700


On 2009 Oct 09, at 08:24, Corbin Dunn wrote:

What you are doing will not work.

You have to create an NSTableHeaderCell subclass. Even then, you may have to subclass NSTableHeaderView to get it to work like a button with a button in it (header's are essentially buttons).

Yes, I found that to be the case

Ah, I take back my congratulations Zhang. When you said you had the button in there I assumed that you had done the hard parts.

Indeed, as Corbin implies, getting custom behavior in an table header ain't easy. I'm attaching a couple of classes which I probably worked on for quite some time, to get similar behavior, a popup menu into a table header.

Attachment: SSYPopUpTableHeaderCell.h
Description: Binary data



Attachment: SSYPopUpTableHeaderCell.m
Description: Binary data



Attachment: SSYTableHeaderView.h
Description: Binary data



Attachment: SSYTableHeaderView.m
Description: Binary data





Possibly you can use the same design pattern. Note the little tricks and fudges that were needed. Also the comments contain references to others' work which I learned from. Have fun!

_______________________________________________

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: How to set checkbox state in TableView columnheader
      • From: "Zhang Li" <email@hidden>
References: 
 >How to set checkbox state in TableView columnheader (From: "Zhang Li" <email@hidden>)
 >Re: How to set checkbox state in TableView columnheader (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: Hide an Item on Desktop
  • Next by Date: Re: Detecting if application is running as Finder
  • Previous by thread: Re: How to set checkbox state in TableView columnheader
  • Next by thread: Re: How to set checkbox state in TableView columnheader
  • Index(es):
    • Date
    • Thread