-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/23/11 4:19 PM, Julie Porter wrote:
> 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?

Sorry to jump in a little late into this conversation, but have you
read the Scroll View Programming Guide
(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/Introduction.html),
in particular the section titled "Creating and Configuring a Scroll View?"

I ask because it seems like you have some basic misunderstandings
about how NSScrollView works.  (This is not surprising - it's a very
complex piece of machinery that I spent several evenings agonizing
over before coming to something of truce with the framework.)

For example, you don't use a delegate to set the content size or
document size (which are two distinct and very confusingly named
attributes).  You typically set them by setting the associated views
themselves.

> I am not familiar with what a scrubbing interface would be.  Can
> you suggest some examples.

See any non-linear video or audio editor.  If you don't want to deal
with setting up an import into iMovie, take a look at about a minute
in or so of http://www.youtube.com/watch?v=Z9Jt9d5ZFZY (I just found
this via Google, so I can't vouch for purported instruction itself).

> My understanding once I get the view set up drawRect will give me
> a rectangle, where the bottom of the rectangle would be the line to
> start drawing.  The top of the rectangle would be the limit to stop
> drawing at.   The rectangle would be in my coordinate space and
> scaled appropriately.

You are right about the coordinate space, but remember that
NSScrollView does not handle zooming (scaling?) - that is up to you.
(Note that UIScrollView, the analogous iOS class, DOES have some
facilities to assist with zooming.  It is very important therefore
that you keep clear which one you mean when you say "scroll view" -
there IS a UIScrollViewDelegate protocol, for example, but no
NSScrollViewDelegate.)

The way you probably want to think about drawRect: is that the rect
passed in is the dirty rect, that is, it is the region you MUST draw
because it is coming on screen or getting updated.  You CAN draw
outside, but this is a waste of processor cycles.  If you are doing
small amounts of simple drawing it is often easier to just redraw
everything (ignoring the passed in rect), but in your case, with a
huge document view, you will definitely want to only draw in the
requested rect.

In practice, what will happen (as I understand it) is that when the
scroll view first draws you will get a drawRect: call for the
- -documentVisibleRect.  If you scroll, you will then only get a
drawRect: requesting the narrow strip that scrolled onto screen;
NSScrollView (or, rather, the NSClipView therein) will copy and
translate as much of the drawn content as possible and then ask for
only the remainder.

> Simply that there are too many choices to choose from.  Ironic in
> that I am a postscript programmer, a language that is the
> definition of obfuscation.   Perhaps I am thinking backwards here?
> 
> Do I use delegates or bindings?  There are some setup wizards, but
> when one runs them,  there are no code parameters to change.  It is
> like I have to read the mind of the application engineer that
> defined the class. But I digress ..

I don't see how bindings come into this.  I'm also unclear by what you
mean by "setup wizards" - are you referring to Xcode templates, or...?

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFOVD4YaOlrz5+0JdURAnxqAJ9QTv5083D/m7zXGg5d/6HDq8e/xQCfYaeI
1ODVesMeKRLOewalBMsiZZE=
=2n8Z
-----END PGP SIGNATURE-----
_______________________________________________

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