Re: [SOLVED] NSScrollView: General Question When does scrollRectToVisible does not scroll?
Re: [SOLVED] NSScrollView: General Question When does scrollRectToVisible does not scroll?
- Subject: Re: [SOLVED] NSScrollView: General Question When does scrollRectToVisible does not scroll?
- From: Georg Filios <email@hidden>
- Date: Mon, 25 Jun 2007 20:28:15 +0200
Hi I.S, Hi Alastair,
thanks for your response. Actually you helped me, just by asking the
right, question.
What actually helped was the following:
> If -scrollToRect: results in a NO, then it didn't have to scroll
to make "rect" visible.
For others, here is what I did, and why it just worked partly:
I have method, that gets called, whenever the user the wants to
change the scaling factor of the displayed View.
I than calculated the new image Size and the relevant viewable
rectangle.
and then I already tried to move the rectangle. (Although I didnt
made the final image sizing)!
and of course if the calculated view size changes from 100,100 to
10000, 10000 and I want to move the center from 50,50 to 5000,5000
(in the final view, which wasnt painted yet)
it stumbles, and does not work, because the image was still 100,100.
But, unfortunatly i nearly always had the setup such, that the above
extrem situation was nearly not happening.
Ok, now I calculate the final size, do the actual image scaling, and
scroll then!
Best regards,
Georg
On 25.06.2007, at 19:12, Alastair Houghton wrote:
On 24 Jun 2007, at 12:48, Georg Filios wrote:
IBOutlet NSScrollView * scrollView;
(void) doScrolling
{
BOOL success =[[scrollView contentView] scrollRectToVisible;
// ==> success = NO (in certain cases)
}
When are you calling this method? It could be that you're calling
it at a time that doesn't make sense (e.g. during an existing
scroll-to-visible request).
Another thing to check would be what the rectangle you're passing
looks like; stick something like
NSLog (@"(%f, %f) %f x %f", rect.origin.x, rect.origin.y,
rect.size.width, rect.size.height);
in your code and see what it says. Maybe you're passing a funny
rectangle.
Kind regards,
Alastair.
--
http://alastairs-place.net
Georg Filios
------------------------------------------------------------------------
-------------------------
Berliner Strasse 1
41472 Neuss
Tel Privat: +49 2131 3868790
Tel Mobil: +49 160 94439860
Mail: email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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