Ask a Question related to Mac Programming, Design and Development.
-
matt neuburg #1
Re: [NSView scrollRect:by:]
In <BB66C1E8.3E36%nospam@nospam.org> Tim R Johnson wrote:
I am looking at the docs. They say that the way you use this methods is> Here is an example of some code that does not work properly...
>
> NSSize deltaSize;
> deltaSize.width = 3;
> deltaSize.height = 3;
>
> [self scrollRect:[self bounds] by:deltaSize];
like this:
1. Invoke scrollRect:by: to copy the rendered image.
2. Move the view object's origin or scroll it within its superview.
3. Calculate the newly exposed rectangles and invoke either
setNeedsDisplay: or setNeedsDisplayInRect: to draw them.
Where's 2 and 3? 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
-
Drawing in a subclass of NSView
I've created my own subclass of NSView -- call it myView. In it, I create an NSMatrix that I sometimes update. When the update is necessary, as... -
Tim R Johnson #2
Re: [NSView scrollRect:by:]
I have created a test project to try and find the problem I'm having with
ScrollRect (outside of my large project). You can find it at
[url]http://www.timslefler.com/files/ScrollRectText.hqx[/url]
Any help would be great, I'm in a real bind without it.
If you run the application and pan from the bottom right to top left, it
(scrollrect) works, but if you pan from bottom left to top right it doesn't
work. If X and Y are the same sign it will not work. Strange.
Thanks
T
in article [email]20030818185929841-0700@news.la.sbcglobal.net[/email], matt neuburg at
[email]matt@tidbits.com[/email] wrote on 8/18/03 6:58 PM:
> In <BB66C1E8.3E36%nospam@nospam.org> Tim R Johnson wrote:
>>>> Here is an example of some code that does not work properly...
>>
>> NSSize deltaSize;
>> deltaSize.width = 3;
>> deltaSize.height = 3;
>>
>> [self scrollRect:[self bounds] by:deltaSize];
> I am looking at the docs. They say that the way you use this methods is
> like this:
>
> 1. Invoke scrollRect:by: to copy the rendered image.
> 2. Move the view object's origin or scroll it within its superview.
> 3. Calculate the newly exposed rectangles and invoke either
> setNeedsDisplay: or setNeedsDisplayInRect: to draw them.
>
> Where's 2 and 3? m.Tim R Johnson Guest



Reply With Quote

