| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I have this code for a subclass of NSBox.
@implementation MXMetalBox
- (void)drawRect:(NSRect)rect
{
if ([self boxType] == NSBoxSeparator) {
NSRect __rect;
float* __c = NULL;
BOOL __increment = NO;
if (rect.size.width < rect.size.height) {
__rect = NSInsetRect(rect, 2.0, 0.0);
__c = &__rect.origin.x;
__increment = YES;
}
else {
__rect = NSInsetRect(rect, 0.0, 2.0);
__c = &__rect.origin.y;
}
[[NSColor colorWithCalibratedWhite:0.55 alpha:0.85] set];
NSRectFill(__rect);
if (__increment) {
(*__c)++;
[[NSColor colorWithCalibratedWhite:0.9 alpha:0.90] set];
}
else {
(*__c)--;
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.90] set];
}
NSRectFill(__rect);
}
else {
[super drawRect:rect];
}
}- (BOOL)isOpaque
{
return NO;
}@end
-- Michael
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.