Re: Recalculating an NSScrollView
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