• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSView -scrollPoint doesn't work with mouse wheel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView -scrollPoint doesn't work with mouse wheel?


  • Subject: Re: NSView -scrollPoint doesn't work with mouse wheel?
  • From: Allen Dang <email@hidden>
  • Date: Tue, 1 Jan 2008 10:51:13 +0800


在 2008-1-1,上午1:50, Bill Bumgarner 写道:
If the scroll view contains a text view, then use NSText's - (void)scrollRangeToVisible:(NSRange)range; method.

For NSView, try -scrollRectToVisible: instead. It is sort of the focal point for all scrolling operations in NSView.

However, if the behavior persists then -- obviously -- something else is going on. Are you setting the scrolling position from a thread, perchance? That could cause confusion.

b.bum

I'm trying to implement a auto scroll down mechanism in a NSTextView. I use a NSTimer to trigger following code:


- (void)startScroll:(NSTimer *)theTimer
{
//Start scroll.
NSPoint currentScrollPosition=[[scrollView contentView] bounds].origin;
NSPoint maxPosition = NSMakePoint(0.0,NSMaxY([[scrollView documentView] frame])
-NSHeight([[scrollView contentView] bounds]));

if (currentScrollPosition.y < maxPosition.y)
{
NSPoint newPosition = NSMakePoint(currentScrollPosition.x, currentScrollPosition.y + 1);

[[scrollView documentView] scrollPoint:newPosition];
}
}


Allen Dang
email@hidden



_______________________________________________

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


References: 
 >NSView -scrollPoint doesn't work with mouse wheel? (From: Allen Dang <email@hidden>)
 >Re: NSView -scrollPoint doesn't work with mouse wheel? (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Replacements for Depracated NSIsSymbolNameDefined(), NSLookupAndBindSymbol()
  • Next by Date: Re:Binding to one specific object of an NSArrayController
  • Previous by thread: Re: NSView -scrollPoint doesn't work with mouse wheel?
  • Next by thread: Replacements for Depracated NSIsSymbolNameDefined(), NSLookupAndBindSymbol()
  • Index(es):
    • Date
    • Thread