• 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: NSSegmentedControl drawing problems in unified toolbar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSegmentedControl drawing problems in unified toolbar


  • Subject: Re: NSSegmentedControl drawing problems in unified toolbar
  • From: Todd Yandell <email@hidden>
  • Date: Mon, 6 Feb 2006 14:03:30 -0600


On Feb 6, 2006, at 12:46 PM, Keith Blount wrote:

I guess I'll have to subclass and do the drawing myself... Annoying. There must be a private method that checks the window style before drawing - it's a shame there's no way of just overriding this.

Here's a custom subclass of NSSegmentedControl I made to get around that bug. It uses a private method, but it still works nicely. Feel free to do whatever you want with this code:


#define NSSegmentedCellAquaStyle 1 // Like the tabs in an NSTabView.
#define NSSegmentedCellMetalStyle 2 // Like the Safari and Finder buttons.


@interface NSSegmentedCell ( Private )
- (void)_setSegmentedCellStyle:(int)style;
@end

@interface AOSegmentedControl : NSSegmentedControl
{
}
@end

@implementation AOSegmentedControl

- (void)awakeFromNib
{
	// 26 is the height of normal-sized segmented control:
	[self setFrameSize:NSMakeSize([self frame].size.width, 26)];
}

- (NSCell *)cell
{
	NSSegmentedCell *cell = [super cell];
	[cell _setSegmentedCellStyle:NSSegmentedCellAquaStyle];
	return cell;
}

@end

Todd
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSSegmentedControl drawing problems in unified toolbar
      • From: Seth Willits <email@hidden>
References: 
 >Re: NSSegmentedControl drawing problems in unified toolbar (From: Keith Blount <email@hidden>)

  • Prev by Date: animated button
  • Next by Date: Re: NSSegmentedControl drawing problems in unified toolbar
  • Previous by thread: Re: NSSegmentedControl drawing problems in unified toolbar
  • Next by thread: Re: NSSegmentedControl drawing problems in unified toolbar
  • Index(es):
    • Date
    • Thread