• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: missing vertical scroll bar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: missing vertical scroll bar
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: NSPanel and mouse input / activation
  • Next by Date: Re: iTunes COM interface for Windows; need the equivalent for
  • Previous by thread: Re: missing vertical scroll bar
  • Next by thread: Re: missing vertical scroll bar
  • Index(es):
    • Date
    • Thread