Constrain scroll point of a text view
Constrain scroll point of a text view
- Subject: Constrain scroll point of a text view
- From: Keith Blount <email@hidden>
- Date: Fri, 14 Jul 2006 08:25:01 -0700 (PDT)
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:
This email sent to email@hidden