scrollRectToVisible:
scrollRectToVisible:
- Subject: scrollRectToVisible:
- From: email@hidden
- Date: Fri, 16 Feb 2007 12:55:51 +0100 (CET)
- Importance: Normal
Hello all,
in my Document-based Cocoa project I have among other things a NSView
inside a scroll view and I should like
the saved document to remember not only the contents of the view but also
which part of the view was last displayed, in order to make
the view reappear "exactly as it was" when the document is re-opened. To
that end, I have
a variable lastSeenRect and my WindowControllerDidLoadNib: method
I have the line
[myView scrollRectToVisible: lastSeenRect];
Unfortunately, after [myView scrollRectToVisible: r] has been executed
there is no guarantee
that the value of [myView visibleRect] will be exactly r, as I learned to
my expense.
(it seems that the scrollRectToVisible method does not bother to be too
precise : in the example
I considered the lastSeenRect is
$2 = {origin = { x = 0, y = 9566 }, size = {width = 213, height = 378 }
}
but the value of [myView visibleRect] after the command has been executed is
$3 = {origin = { x = 0, y = 411 }, size = {width = 213, height = 378 }
(the original visible rect was
$1 = {origin = { x = 0, y = 0 }, size = {width = 213, height = 378 }).
so that the new visible rectangle is disjoint from the rectangle I asked
the view to display !
What should be done to fix this ?
Thanks in advance.
Ewan
_______________________________________________
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