NSScrollView右下角的处理

 
@interface MyScrollView : NSScrollView 
{ } 
@end   
@implementation MyScrollView  
- (void)drawRect:(NSRect)rect
{     
      [super drawRect: rect];      
      if([self hasVerticalScroller] && [self hasHorizontalScroller])
        {         
             NSRect vframe = [[self verticalScroller]frame];         
             NSRect hframe = [[self horizontalScroller]frame];         
             NSRect corner;         
             corner.origin.x = NSMaxX(hframe);         
             corner.origin.y = NSMinY(hframe);         
             corner.size.width = NSWidth(vframe);         
             corner.size.height = NSHeight(hframe);         
              // your custom drawing in the corner rect here         
             [[NSColor redColor] set];         
             NSRectFill(corner); 
       } 
} 
@end 


   

你可能感兴趣的:(NSScrollView右下角的处理)