Re: ScrollView change notification
Re: ScrollView change notification
- Subject: Re: ScrollView change notification
- From: Troy Stephens <email@hidden>
- Date: Tue, 13 Sep 2005 10:28:20 -0700
On Sep 10, 2005, at 9:42 PM, MUHAMMAD ALI T K wrote:
Hi All,
I have a main view and subviews inside that main view.
The main view is the subclass of NSClipView so that if the display
resolution changes or window is resized scrollers should appear
inorder to
facilitate the user see the entire window.
In order to get scrollers to appear, you'll want to change your main
view to be an ordinary NSView (or subclass of NSView), and set it as
the "document view" of an NSScrollView. (You can do this in
Interface Builder. Just create the document view first, then select
it and choose "Layout -> Make subviews of -> Scroll View" in the
menu.) The NSScrollView automatically provides vertical and
horizontal NSScrollers, as well as a containing NSClipView.
On 10.3 and later, you can set the NSScrollView to "autohide
scrollers", and the scrollers will be automatically hidden when they
are not needed.
Is there any notification, delegate or any other way to notify the
scroll
bars' movements?
Scrolling is achieved by moving the origin of the NSClipView's bounds
rectangle. So you can receive notification of changes to the scroll
position by adding yourself as an observer of
NSViewBoundsDidChangeNotification for the NSScrollView's NSClipView
([theScrollView contentView]).
--
Troy Stephens
Cocoa Frameworks
Apple Computer, Inc.
_______________________________________________
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