• 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
drawing border of NSPopUpButtonCell drawInteriorWithFrame:inView:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drawing border of NSPopUpButtonCell drawInteriorWithFrame:inView:


  • Subject: drawing border of NSPopUpButtonCell drawInteriorWithFrame:inView:
  • From: Shane <email@hidden>
  • Date: Sat, 15 May 2010 21:17:27 -0500

This is a data table header cell of type NSPopUpButtonCell where I'm
trying to draw the bottom border of the cell.

The problem is that the border along the bottom of each
NSPopUpButtonCell only extends across part of the cell, not the entire
length of the cell.

The docs say about the cellFrame "The bounding rectangle of the
receiver, or a portion of the bounding rectangle". And I'm certainly
only seeing a portion of the cells frame being drawn.

Am I doing this wrong?

- (void) drawInteriorWithFrame:(NSRect) cellFrame inView:(NSView *) controlView
{
	[[NSColor whiteColor] set];
	[[NSBezierPath bezierPathWithRect:cellFrame] fill];

	NSBezierPath *path = [NSBezierPath bezierPath];

	[path moveToPoint:NSMakePoint(cellFrame.origin.x, cellFrame.size.height)];
	[path lineToPoint:NSMakePoint(cellFrame.size.width, cellFrame.size.height)];

	[[NSColor darkGrayColor] setStroke];

	[path stroke];

	[super drawInteriorWithFrame:cellFrame inView:controlView];

	return;
}


I hope this comes out right, I tried to draw what my
NSPopUpButtonCells borders look like. The bottom border is 50%
incomplete for cell 2 and cell 4, and just not there for cell 3.
__________________________________________
Cell1  |  Cell2  |  Cell 3  |  Cell 4
---------------                    ------------------------
_______________________________________________

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: drawing border of NSPopUpButtonCell drawInteriorWithFrame:inView:
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: drawing into a hidden view
  • Next by Date: Re: drawing into a hidden view
  • Previous by thread: How did Snow Leopard kill my table view?
  • Next by thread: Re: drawing border of NSPopUpButtonCell drawInteriorWithFrame:inView:
  • Index(es):
    • Date
    • Thread