15 #ifndef COCOA_SCROLL_BOX_M
16 #define COCOA_SCROLL_BOX_M
23 - (id)initWithFrame:(NSRect)frame {
24 self = [
super initWithFrame:frame];
29 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(layoutSubviews) name:NSViewFrameDidChangeNotification object:self];
35 [[NSNotificationCenter defaultCenter] removeObserver:self];
46 #define borderDistance 8.0
47 #define cellDistance 4.0
49 -(void) layoutSubviews {
51 NSView *documentView = [
self documentView];
55 NSSize contentSize = [
self contentSize];
57 NSRect newFrame = NSMakeRect(0.0, 0.0, neededMinSize.width, neededMinSize.height);
59 newFrame.size.width = contentSize.width;
61 newFrame.size.height = contentSize.height;
63 [documentView setFrame:newFrame];
67 -(void) setLayoutedDocumentView:(NSView*)new_documentView {
68 [
self setDocumentView:new_documentView];
69 [
self layoutSubviews];
72 #pragma mark Protocoll Methods
75 return NSMakeSize(50.0, 50.0);