• 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
Problem scrolling a clip view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem scrolling a clip view


  • Subject: Problem scrolling a clip view
  • From: email@hidden
  • Date: Mon, 21 May 2007 15:43:02 +0200

I'd like to programmatically scroll my clip view in a smooth fashion.
So I tried with the code below. It works, but the clip view is not
updated until the loop finishes, eg. the whole thing equals a 100
pixel jump without scroll. I cannot see any logical reason for this.
Please help.


NSView *documentView = [[[webView mainFrame] frameView] documentView]; NSClipView *clipView = (NSClipView *)[documentView superview]; NSScrollView *scrollView = (NSScrollView *)[clipView superview]; NSPoint currentScrollPosition=[[scrollView contentView] bounds].origin; struct timeval delay; memset (&delay, 0, sizeof(delay) ); delay.tv_usec = 1000; // Delay in micro seconds

	int i = 0;
	while (i != 100) {
	i = i + 1;
	[clipView scrollToPoint:(NSPoint) [clipView
constrainScrollPoint:NSMakePoint(currentScrollPosition.x,
currentScrollPosition.y + i)]];
	select ( 0, (fd_set*)nil, (fd_set*)nil, (fd_set*)nil, &delay);
	}
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Problem scrolling a clip view
      • From: "I. Savant" <email@hidden>
    • Re: Problem scrolling a clip view
      • From: j o a r <email@hidden>
  • Prev by Date: available languages
  • Next by Date: Re: Problem scrolling a clip view
  • Previous by thread: Re: available languages
  • Next by thread: Re: Problem scrolling a clip view
  • Index(es):
    • Date
    • Thread