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

Re: NSTableHeaderCell


  • Subject: Re: NSTableHeaderCell
  • From: Steve Christensen <email@hidden>
  • Date: Tue, 3 Feb 2004 06:30:30 -0800

How about the following in your drawInteriorWithFrame:inView: code:

NSString* headerTitle = [self stringValue];

if ((headerTitle != nil) && ([headerTitle length] > 0))
{
// draw the triangle
}

...and similarly use the above when hit testing the triangle.


On Feb 2, 2004, at 5:58 PM, Todd Lair wrote:

I've created a NSTableHeaderCell child class which overloads the drawInterior method to draw a triangle notch so that when clicked, will display a popup menu. This works great.

My problem is when this cell is used as the last column in the table. When the column is resized so that the width of the total columns is less than the width of the parent TableView, the TableView creates a dummy or empty column. This empty column has my notch in it's header, so I think my cell is being used to draw that dummy column. Is there anyway I can tell inside the cell's draw routine whether or not I should display the notch? I tried isEnabled but that reports yes always, and I tried looking at the frame rect's but those don't seem to ever be greater than the last column rects.

I suppose I could override the header view's draw method to ensure the notch doesn't get drawn, but the cell is in a plugin and the tableview along with its header is in the main program, so I'd like it to be oblivious to the header cell's existence completely.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSTableHeaderCell (From: Todd Lair <email@hidden>)

  • Prev by Date: Packager Follow Up
  • Next by Date: Re: Hyphenation?
  • Previous by thread: NSTableHeaderCell
  • Next by thread: Extending AppleScript "open" in Cocoa apps
  • Index(es):
    • Date
    • Thread