Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Constrain scroll point of a text view



Hello,

My app allows for full screen text editing, but this
has the unfortunate side-effect that once the user has
typed to the bottom of the screen, the cursor will
remain at the bottom of the screen as the text scrolls
up as you type each new line. It is somewhat annoying
to always be staring at the bottom of the screen like
this, and some of my users have requested that the
scroll point be optionally constrained to the middle
of the text view. I have seen this behaviour in one
other app, Blue-Tec's Ulysses, and they call it
"typewriter scrolling", which is a very good metaphor.

Does anybody have any idea of the best way to go about
this? I thought I could put the text view within
another NSView that sized itself half a visibleFrame
height higher than the text view and doing some fancy
calculations for calling scrollToPoint: whenever the
user types, but this seems a rather complicated way of
going about it. Could I override NSClipView's
-constrainScrollPoint: to get the effect I want?

Any suggestions would be much appreciated.

All the best,
Keith

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.