views:

48

answers:

1

I'm making a Cocoa application optimized for external touch sensitive screens, so I want to make a large scollbar in an NSScrollView. I've tried just to resize the scrollers frame, but both drawing and mouse events only happens in the scroll area, it doesn't get wider (it's the vertical scroller). This is the code I'm using (from the subclassed NSScrollView):

- (void)tile{
[super tile];

NSScroller *vertScroll = [self verticalScroller];
NSRect vertScrollFrame = [vertScroll frame];

NSView *content = [self contentView];
NSRect contentFrame = [content frame];

contentFrame.size.width -= 50;
vertScrollFrame.origin.x -= 50;
vertScrollFrame.size.width += 50;

[vertScroll setFrame:vertScrollFrame];
[content setFrame:contentFrame];
}

I've tried to subclass the NSScroller, but I don't know how I would extent it.

A: 

Does your customized scroll view exist in a nib/xib? If so, have you set the scroll view's class identity in Interface Builder to the name of your custom class? It's found in the "Identity" tab of the Inspector window.

Joshua Nozzi