Remembering the state of an NSScrollView?
Remembering the state of an NSScrollView?
- Subject: Remembering the state of an NSScrollView?
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 8 Feb 2007 17:06:47 -0700
I searched the archives and didn't see any answers to the following
question...
I need the current scroll location of an NSScrollView to be
remembered between launches. The scroll view contains a view that is
scrolled only vertically. Currently I'm getting the position of the
scroll view like this:
return [[[myView enclosingScrollView] contentView] bounds].origin;
Then I save the results to user defaults, and reload it like this:
[myView scrollPoint:aPoint];
This is called _after_ the view is resized to the size it was when we
saved its state. The problem is, either the scroll point calculation
when saving the view is way off, or -scrollPoint: is sending it to
the wrong place. Either way, when I scroll halfway through the view
and then have it save its state, when restoring it it's scrolled all
the way to the bottom.
Has anyone done something like this before? If so, then what worked
for you?
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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