Scrolling Behavior of NSTextView
Scrolling Behavior of NSTextView
- Subject: Scrolling Behavior of NSTextView
- From: Dong Feng <email@hidden>
- Date: Mon, 7 Jun 2010 23:44:23 +0800
I encountered a wired behavior of NSTextView. I tried to use the following
statement to scroll to top:
[[_scrollView documentView] scrollPoint:NSMakePoint(0, 0)];
where the *documentView* is a NSTextView. But it seems when the window is in
certain size, the scroll-to-top behavior does not take effect. Then I added
a seemingly irrelevant statement before the above statement, by accidental,
so the fragment become the follows:
[[[_scrollView documentView] layoutManager]
glyphRangeForTextContainer:[[self dictionaryContent] textContainer]];
[[_scrollView documentView] scrollPoint:NSMakePoint(0, 0)];
The complete source code is at http://techsingular.net/dict_mac/dict_mac.dmg
The problem happens when you search for "灵" or "神" through this dictionary
program.
Dong
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden