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 caseAh, 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.
SSYPopUpTableHeaderCell.h
Description: Binary data
SSYPopUpTableHeaderCell.m
Description: Binary data
SSYTableHeaderView.h
Description: Binary data
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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com