RE: missing vertical scroll bar
RE: missing vertical scroll bar
- Subject: RE: missing vertical scroll bar
- From: Joel Norvell <email@hidden>
- Date: Fri, 17 Jul 2009 13:36:16 -0700 (PDT)
Dale,
I believe the recipe you want involves shoe-horning the scrollViewRect into its containing window.
For an example, look at the DocumentWindowController's resizeWindowForViewSize method in TextEdit (shown below).
HTH,
Joel
- (void)resizeWindowForViewSize:(NSSize)size
{
NSWindow *window = [self window];
NSRect origWindowFrame = [window frame];
if (![[self document] hasMultiplePages])
{
size.width += (defaultTextPadding() * 2.0);
}
NSRect scrollViewRect = [[window contentView] frame];
scrollViewRect.size = [[scrollView class] frameSizeForContentSize:size
hasHorizontalScroller:[scrollView hasHorizontalScroller]
hasVerticalScroller:[scrollView hasVerticalScroller]
borderType:[scrollView borderType]];
NSRect newFrame = [window frameRectForContentRect:scrollViewRect];
newFrame.origin = NSMakePoint(origWindowFrame.origin.x,
NSMaxY(origWindowFrame) - newFrame.size.height);
[window setFrame:newFrame display:YES];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden