• 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: scrolling and drawing porblems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scrolling and drawing porblems


  • Subject: Re: scrolling and drawing porblems
  • From: Ivan Kourtev <email@hidden>
  • Date: Tue, 7 Nov 2006 10:15:01 -0500

I subclassed NSScrollView to try and draw under my custom view. But I am seeing weird things.

First, I am not drawing any background in my custom view but still don't see the drawing in the custom enclosing NSScrollView? Drawing in the custom NSScrollView started showing after only I overrode isOpaque of my custom view to return YES, which has me thoroughly confused.

So if my custom view's isOpaque is not overridden at all, or if it returns NO, the drawing in the enclosing custom NSScrollView does not show. Isn't that exactly the opposite of what it should be?


On Nov 6, 2006, at 6:53 PM, Erik Buck wrote:

Here are a bunch of ideas in roughly decreasing order of sensibility:

  1) Try turning off copies on scroll behavior:

setCopiesOnScroll: Controls whether the receiver copies rendered images while scrolling.
- (void)setCopiesOnScroll:(BOOL)flag
Discussion If flag is YES, the receiver copies the existing rendered image to its new location while scrolling and only draws exposed portions of its document view. If flag is NO, the receiver always forces its document view to draw itself on scrolling.
Availability
Available in Mac OS X v10.0 and later.
See Also
– copiesOnScroll


2) You can also send your view a -setNeedsDisplay: message and the whole visible rect will be marked as needing redisplay.

3) You can also draw your immovable graphics as part of the clip view or part of the enclosing scroll view instead of part of the scrollview's document view. Think about the way the scrollview draws rulers. You can do that too via overriding the -tile method.

4) You can also draw your immovable graphics in a transparent child window overlaying the scroll view.

5) You could use a subview of your scrollview's document view to draw the immovable graphics. Then whenever the document view's visible rect changes, reposition the subview which will cause a redraw when appropriate.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: scrolling and drawing porblems
      • From: m <email@hidden>
References: 
 >Re: scrolling and drawing porblems (From: Erik Buck <email@hidden>)

  • Prev by Date: Re: Problem in Customize toolbar palette.
  • Next by Date: please help: menu items with attributed strings are appearing blank
  • Previous by thread: Re: scrolling and drawing porblems
  • Next by thread: Re: scrolling and drawing porblems
  • Index(es):
    • Date
    • Thread