• 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 a custom NSTabView Border
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing a custom NSTabView Border


  • Subject: Drawing a custom NSTabView Border
  • From: Mr.Gecko <email@hidden>
  • Date: Fri, 17 Sep 2010 17:29:37 -0500

Hello I'm wondering what will be the best way to draw a custom NSTabView Border. I have tried many things and it always ends up that I fail. The border gets drawn, but the objects in the Tab View, if you focus them, has a black edge around them, that is not elegant at all. Is there any examples on the internet that I could look at? This is my code below.

- (void)awakeFromNib {
	[self setTabViewType:NSNoTabsNoBorder];
	[self setDrawsBackground:NO];
}

- (void)drawRect:(NSRect)frameRect {
	float lineSize = 2.0;
	float transparentcy = 0.87;
	NSBezierPath *strokePath = [NSBezierPath bezierPathWithRect:frameRect];
	[strokePath setLineWidth:lineSize];
	NSBezierPath *path = [NSBezierPath bezierPathWithRect:frameRect];

	[[NSColor colorWithCalibratedWhite:1.0 alpha:transparentcy] set];
	[path fill];
	[[NSColor colorWithCalibratedWhite:transparentcy-0.3 alpha:1.0] set];
	[strokePath stroke];
	[super drawRect:frameRect];
}

Thanks for any help,
Mr. Gecko_______________________________________________

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 a custom NSTabView Border
      • From: "Mr. Gecko" <email@hidden>
    • Re: Drawing a custom NSTabView Border
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: bindings and NSNumberFormatter, enforcing min/max values
  • Next by Date: Is it possible to have a plist date to be null?
  • Previous by thread: [moderator] Re: (no subject)
  • Next by thread: Re: Drawing a custom NSTabView Border
  • Index(es):
    • Date
    • Thread