On Aug 23, 2011, at 4:19 PM, Julie Porter wrote:

>> Your best bet is to not completely dump IB, but to simply set the 
>> contentSize programatically as soon as you load your document.
>> 
> This is what I am having issue with.    How and where to put the delegates?  
> Specifically what file would I place them into?  Or do I create a new file 
> for the delegate that does this?

The scroll view will set its scrolling range based on the size of the frame of 
its embedded document view, which is the view that you draw into. So there’s no 
need to set a document size in IB. Just make the document view an instance of 
your custom view class (drag in a Custom View object, set it to your class, 
then do Embed In Scroll View).

At runtime when you load the data your view can calculate how large it needs to 
be and set its frame rect appropriately. The scroll view will detect that and 
change the scroll range.

One warning about extremely large views is that at some point you will run into 
floating-point rounding errors, since AppKit and CoreGraphics coords are 32-bit 
floats and have only 24 bits of precision. Still, that should get you to 
millions of pixels before the coords stop being pixel-accurate.

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to