Ask a Question related to Mac Programming, Design and Development.
-
Alain Birtz #1
ScrollView and drawRect
The view is made with Interface Builder as Custom View and
the scrollview is build with the "Layout -> Make subview of -> Scroll View" menu
The view hold some text and graphics all done in drawRect method.
Each time a scroll is needed (mouse click in arrow) drawRect is called.
But there is no need to redraw anything since there is nothing new (text
or graphics)
in the custom view. Every text and graphics was already made in the custom view
by the previous drawRect call, even the ones that not covered by the
scroll rectangle.
If I force drawRect to do nothing when a mouse click in lower arrow
happen, an empty rectangle
appear at the bottom of the view rectangle.
Is there any way to rebuild text and graphics only when some change
was made in these text and graphics ?
My scrolling is too slow because drawRect must compute each time
a large rectangle of text and graphics. How to do this work only one time
and just show other part of the text and graphics rectangle when scrolling
happen ?
Alain Birtz Guest
-
Problems using unscaledWidth and drawRect inupdateDisplayList
Please help me with this one, it has to be a bug of some sort because it makes no sense. Maybe you have an answer or know a better way to do this. ... -
(the stage). & 'rect','drawRect'?????
Hi, I have a MIAW which I initially want to open as 320x240. Fine- no problem. Then, I want to let the user click a sprite to make the MIAW... -
the stage.drawrect
I'm trying to scale my movie to fit the user's screen. The movie was designed at 1024x768. I've tried to automatically scale the movie using: ... -
matt neuburg #2
Re: ScrollView and drawRect
In <abz-1209030929190001@192.168.1.3> Alain Birtz wrote:
Store the drawn computed "large rectange of text and graphics" in an> The view is made with Interface Builder as Custom View and
> the scrollview is build with the "Layout -> Make subview of -> Scroll
> View" menu
>
> The view hold some text and graphics all done in drawRect method.
>
> Each time a scroll is needed (mouse click in arrow) drawRect is called.
> But there is no need to redraw anything since there is nothing new (
> text or graphics) in the custom view. Every text and graphics was
> already made in the custom view by the previous drawRect call, even
> the ones that not covered by the scroll rectangle.
>
> If I force drawRect to do nothing when a mouse click in lower arrow
> happen, an empty rectangle
> appear at the bottom of the view rectangle.
>
> Is there any way to rebuild text and graphics only when some change
> was made in these text and graphics ?
>
> My scrolling is too slow because drawRect must compute each time
> a large rectangle of text and graphics. How to do this work only one
> time and just show other part of the text and graphics rectangle when
> scrolling happen ?
NSImage. Now when drawRect is called, just grab the correct part of that
image. Also make sure drawsBackground is set to YES. m.
--
matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
REALbasic: The Definitive Guide! 2nd edition!
[url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
Subscribe to TidBITS. It's free and smart.
matt neuburg Guest



Reply With Quote

