Re: Remembering the state of an NSScrollView?
Re: Remembering the state of an NSScrollView?
- Subject: Re: Remembering the state of an NSScrollView?
- From: Dominik Pich <email@hidden>
- Date: Fri, 9 Feb 2007 17:21:58 +0100
a) You add it to the superview and the new size is then == the old!?
b) you might want to save the visibleRect's origin?!
Dont know if its any goood but worth a try, I'd say :)
Regards,
Dominik
Am Feb 9, 2007 um 1:06 AM schrieb Nick Zitzmann:
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
_______________________________________________
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