• 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: [SOLVED] NSScrollView: General Question When does scrollRectToVisible does not scroll?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED] NSScrollView: General Question When does scrollRectToVisible does not scroll?


  • Subject: Re: [SOLVED] NSScrollView: General Question When does scrollRectToVisible does not scroll?
  • From: Georg Filios <email@hidden>
  • Date: Mon, 25 Jun 2007 20:28:15 +0200

Hi I.S, Hi Alastair,

thanks for your response. Actually you helped me, just by asking the right, question.

What actually helped was the following:

> If -scrollToRect: results in a NO, then it didn't have to scroll to make "rect" visible.

For others, here is what I did, and why it just worked partly:

I have method, that gets called, whenever the user the wants to change the scaling factor of the displayed View.
I than calculated the new image Size and the relevant viewable rectangle.
and then I already tried to move the rectangle. (Although I didnt made the final image sizing)!



and of course if the calculated view size changes from 100,100 to 10000, 10000 and I want to move the center from 50,50 to 5000,5000 (in the final view, which wasnt painted yet)
it stumbles, and does not work, because the image was still 100,100.


But, unfortunatly i nearly always had the setup such, that the above extrem situation was nearly not happening.

Ok, now I calculate the final size, do the actual image scaling, and scroll then!

Best regards,

Georg










On 25.06.2007, at 19:12, Alastair Houghton wrote:

On 24 Jun 2007, at 12:48, Georg Filios wrote:

IBOutlet NSScrollView * scrollView;

(void) doScrolling
{

BOOL success =[[scrollView contentView] scrollRectToVisible;

	// ==> success = NO (in certain cases)

}

When are you calling this method? It could be that you're calling it at a time that doesn't make sense (e.g. during an existing scroll-to-visible request).


Another thing to check would be what the rectangle you're passing looks like; stick something like

NSLog (@"(%f, %f) %f x %f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);

in your code and see what it says. Maybe you're passing a funny rectangle.

Kind regards,

Alastair.

--
http://alastairs-place.net






Georg Filios

------------------------------------------------------------------------ -------------------------
Berliner Strasse 1
41472 Neuss


Tel Privat: +49 2131 3868790
Tel Mobil: +49 160 94439860

Mail:  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: 
 >NSScrollView: General Question When does scrollRectToVisible does not scroll? (From: Georg Filios <email@hidden>)
 >Re: NSScrollView: General Question When does scrollRectToVisible does not scroll? (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: int to NSString?
  • Next by Date: Re: [OT] Don't draw every 10th sample(!) (Was Re: Best drawing technology for audio waveforms, envelopes, etc.?)
  • Previous by thread: Re: NSScrollView: General Question When does scrollRectToVisible does not scroll?
  • Next by thread: How to render 8-bit bitmap image representation?
  • Index(es):
    • Date
    • Thread