
Signature
Tony Belding, Hamilton Texas
> > Set the frameSize of the custom view to match the contentSize of the
> > scroll view. m.
[quoted text clipped - 7 lines]
> Next thing I'll try is figuring out how to scroll to a part of the map
> programmatically.
Let me save you some trouble, because this part is *really* hard to
figure out from the online manual. You set the origin of the clip view -
this is the content view of your custom view. m.

Signature
matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/exec/obidos/ASIN/0596005571
Read TidBITS! It's free and smart. http://www.tidbits.com
matt neuburg - 26 May 2005 13:54 GMT
> > > Set the frameSize of the custom view to match the contentSize of the
> > > scroll view. m.
[quoted text clipped - 11 lines]
> figure out from the online manual. You set the origin of the clip view -
> this is the content view of your custom view.
I mean it's the content view of the scroll view that contains your
custom view. See why this is hard to explain??? :) m.

Signature
matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/exec/obidos/ASIN/0596005571
Read TidBITS! It's free and smart. http://www.tidbits.com
Tony Belding - 26 May 2005 14:30 GMT
> Let me save you some trouble, because this part is *really* hard to
> figure out from the online manual. You set the origin of the clip view -
> this is the content view of your custom view. m.
Thank you, that helped! Here's what I did:
NSClipView *clipper = [myScrollView contentView];
NSPoint origin;
origin.x = 100.0;
origin.y = 100.0;
[clipper scrollToPoint:origin];
So far, so good. . . It scrolls to the specified point, but it
doesn't update the scroll bars to match. I guess I'll need some
additional code to update those.

Signature
Tony Belding, Hamilton Texas
matt neuburg - 26 May 2005 15:20 GMT
> > Let me save you some trouble, because this part is *really* hard to
> > figure out from the online manual. You set the origin of the clip view -
[quoted text clipped - 11 lines]
> doesn't update the scroll bars to match. I guess I'll need some
> additional code to update those.
Simply tell the scroll view to reflectScrolledClipView:. m.

Signature
matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/exec/obidos/ASIN/0596005571
Read TidBITS! It's free and smart. http://www.tidbits.com
Tony Belding - 26 May 2005 16:05 GMT
>> So far, so good. . . It scrolls to the specified point, but it
>> doesn't update the scroll bars to match. I guess I'll need some
>> additional code to update those.
>
> Simply tell the scroll view to reflectScrolledClipView:. m.
Oh, cool! I thought I'd have to get to the actual scrollbar objects,
do my own calculations, and then explicitly set them to the new
positions.
I should have known better. :) Everything turns out to be so easy
with Cocoa, I love it. I just need to get more familiar with it.
Thanks again for your help!

Signature
Tony Belding, Hamilton Texas