• 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: How to set the scrollers in an NSScrollView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set the scrollers in an NSScrollView?


  • Subject: Re: How to set the scrollers in an NSScrollView?
  • From: Greg Titus <email@hidden>
  • Date: Tue, 24 Jul 2001 11:06:20 -0700

On Tuesday, July 24, 2001, at 05:01 AM, HAEUPL Friedrich - RTAA wrote:

I want to display data graphically in a View. The amplitude of the data is limited to a rang of 0..255.
A part of the data (about 600 points visible) is displayed. As the amount of data points can be
quite huge, it should be possible to scroll to a certain position of the data points and display data
starting from this point. So a scroller is necessary.
The position of the scroller should reflect the position in the datafile and the length of the scroller
should reflect the relation of visible point to the complete amount of points. (Maybe it is necessary
to have a minimum size of the scroller, so that it doesn't become too small)
For performance reasons it is not possible to render all data in the drawRect methode, but only those
that have to be displayed. How do I set the scrollers then?

Actually, you should be able to use a custom view inside a scrollview as normal to do this. Just set the width/height of your custom view to be appropriate for the complete amount of data and the scrollview itself will handle the scrollbars reflecting the relation of visible to complete. The important part is: when your -drawRect: method is called, the rect passed in to the method will be only the VISIBLE part of your view, so as long as you pay attention to that parameter and only draw your points within that rectangle you will never have to render any unneccesary data.

Hope this helps,
--Greg


References: 
 >How to set the scrollers in an NSScrollView? (From: HAEUPL Friedrich - RTAA <email@hidden>)

  • Prev by Date: NSQuickDrawView
  • Next by Date: Re: Clearing an NSView
  • Previous by thread: How to set the scrollers in an NSScrollView?
  • Next by thread: Re: Obj-C vs Java- how about ObjC vs C++
  • Index(es):
    • Date
    • Thread