Re: scrolling and drawing porblems
Re: scrolling and drawing porblems
- Subject: Re: scrolling and drawing porblems
- From: Ivan Kourtev <email@hidden>
- Date: Tue, 7 Nov 2006 15:25:34 -0500
On Nov 7, 2006, at 2:48 PM, m wrote:
On Nov 7, 2006, at 7:15 AM, Ivan Kourtev wrote:
I subclassed NSScrollView to try and draw under my custom view.
But I am seeing weird things.
Perhaps you should try to more concisely communicate what effect
you're trying to achieve.
_murat
Ok, here it is: I want to have a certain object drawn at a constant
position relative to the visible rectangle of my custom view (so that
it's always visible). The problem was that the my custom view was in
a scroll view that by default copies view content on scroll. As both
you and Eric suggested one way to accomplish what I wanted was to
disable the copying. Indeed, something like [[self
enclosingScrollView] setCopiesOnScroll:NO]; in my custom view did the
job.
The side effect of this is that since there is no copying anymore,
the argument to drawRect in my custom view after scrolling is the
entire visible rectangle (rather than just a small strip exposed
after scrolling).
So I wanted to draw my object in the scroll view instead, by
subclassing it. Which I did and then I ran into the problem I
described - I am not drawing any background in my custom view
(enclosed in my custom scroll view) but still don't see the drawing
in the custom enclosing NSScrollView? Drawing in the custom scroll
view started showing only after 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?
The hierarchy is scroll view contains clip view contains my custom
view, correct? So if my custom view does not do any drawing at all,
am I not supposed to see the drawing in the subclassed enclosing
scroll view?
--
ivan
_______________________________________________
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