Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSegmentedControl Display Bug?



Todd, good deal! I've added the AOSegmentedControl to my project and it works great. Much simpler to implement than the window proxy, although that bit of code is an seriously impressive hack.

-Phil

Hi,

I had to get around this bug for one of my projects, too. I did it with a subclass of NSSegmentedControl and a private cell method. I also filed a bug report on it almost two months ago: <rdar:// 4139593>. Anyway, here's how I did it:

#define NormalSegmentedCellStyle 1
#define FlatSegmentedCellStyle 2

@interface AOSegmentedControl : NSSegmentedControl
{
}
@end

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

@implementation AOSegmentedControl

- (void)awakeFromNib
{
    [self setFrameSize:NSMakeSize([self frame].size.width, 26)];
}

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

@end
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: NSSegmentedControl Display Bug? (From: Ruediger Hanke <email@hidden>)
 >Re: NSSegmentedControl Display Bug? (From: Shaun Wexler <email@hidden>)
 >Re: NSSegmentedControl Display Bug? (From: Ruediger Hanke <email@hidden>)
 >Re: NSSegmentedControl Display Bug? (From: Todd Yandell <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.