• 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: Recalculating an NSScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recalculating an NSScrollView


  • Subject: Re: Recalculating an NSScrollView
  • From: Gerard Iglesias <email@hidden>
  • Date: Thu, 4 Nov 2004 11:20:26 +0100

Hello,

What you want is to make the scroll view aware of the document size change, for that you need to resize the document view at the right size your self and the scroll view would be aware automatically, because it is registered to receive document view notification

This is the doc of the NSClipView that contains the document view of the scroll view :

setDocumentView:

- (void)setDocumentView:(NSView *)aView
Sets the receiver’s document view to aView, removing any previous document view, and sets the origin of the receiver’s bounds rectangle to the origin of aView’s frame rectangle. If the receiver is contained in an NSScrollView, you should send the NSScrollView a setDocumentView: message instead, so it can perform whatever updating it needs.

In the process of setting the document view, this method registers the receiver for the notifications
NSViewFrameDidChangeNotification and NSViewBoundsDidChangeNotification, adjusts the key view loop to include the new document view, and updates a parent NSScrollView’s display if needed using reflectScrolledClipView:.
<x-tad-bigger>

</x-tad-bigger>
Best regards

Gerard

Le 3 nov. 04, à 14:10, Tito Ciuro a écrit :

Hello,

I've made a custom control which mimics an NSOutlineView. As expected, clicking the triangles reveals/hides its siblings. I have put this NSView inside an NSScrollView and works partially well, except that the NSScrollView doesn't get updated when I expand the contents of the view. Given that the content can vary constantly, what do I need to do to keep the NSScrollView in-sync with the contents?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Recalculating an NSScrollView (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Re: Custom alpha for standard window?
  • Next by Date: Editing in NSOutlineView.
  • Previous by thread: Re: Recalculating an NSScrollView
  • Next by thread: Lame problem with NSImageView
  • Index(es):
    • Date
    • Thread