|Nov 11, 2010, 05:27 PM||#1|
Scrollbars and big picture
I am writing an application that displays a large graph. When I use an NSScrollView the application slows down as the graph is quite big and therefore slow to draw on a subclass of NSView. Instead I would like to draw only the part of the graph that is visible (the size of the window) but I would still need scrollbars to choose what part of the graph is supposed to be drawn. Does any body as any suggestions about how to implement this as I am new to cocoa. Should I subclass an NSScrollView, or use NSSlider (although they are not very nice)?
|Nov 12, 2010, 12:47 AM||#4|
There is no reason to subclass NSScrollView. Doing so won't solve anything.
If the problem is your BigGraphView, then nothing done by NSScrollView can make BigGraphView draw less. The problem lies in BigGraphView. You wrote:
If you're drawing parts that lie outside the visible part of your view, then stop drawing those parts. You should only draw the parts that lie inside the bounds rect of your document view, which will be set by the content view of the NSScrollView.
If your view is drawing invisible parts, then nothing NSScrollView can do will cause your view to draw less. You have to change how your view draws. When you do that, then NSScrollView will be faster.
If that doesn't make sense, then you don't understand how NSScrollView works. Review the reference doc:
From that reference doc:
The content view is responsible for managing the position of the document view, clipping the document view to the content view's frame, and handling the details of scrolling in an efficient manner. The content view scrolls the document view by altering its bounds rectangle, which determines where the document view’s frame lies.
|Nov 12, 2010, 03:26 PM||#5|
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Don’t ignore the Mac’s importance in Apple’s big picture||MacBytes||MacBytes.com News Discussion||13||Mar 27, 2010 11:37 AM|
|Laptop security: The Big Picture||Doctor Q||MacBook Pro||37||Feb 13, 2008 05:10 AM|
|Possible to have iTunes 7 scrollbar and unified theme on all OS X apps?||dartzorichalcos||OS X||11||Jun 11, 2007 10:03 PM|
|Apple’s iPhone touch screen and the big picture||MacBytes||MacBytes.com News Discussion||9||Mar 20, 2007 07:15 PM|
|Big picture // HUGE picture.||mischief||Community||204||Jun 3, 2002 08:21 PM|
All times are GMT -5. The time now is 08:16 AM.