FROM : Michael Ash
DATE : Fri Jul 28 18:36:43 2006
On 7/28/06, Alan Smith <<email_removed>> wrote:
> Glenn -
> Yes. I tried that:
>
> NSPoint visOrigin = [self visibleRect].origin;
> [[NSGraphicsContext graphicsContextWithWindow: [self window]]
> setPatternPhase:NSMakePoint(visOrigin.x, visOrigin.y)];
> [[NSColor colorWithPatternImage: pattern] set];
> [NSBezierPath fillRect: [self bounds]];
>
> It doesn't have any affect. :(
And *this*, ladies in gentlemen, is a perfect showcase on why you need
to *post your code*.
~15 messages into the thread before we get any code, and it turns out
that the problem has nothing to do with the question being asked.
Whenever you say something like, "I tried X and it didn't work", post
the code that does X. It's entirely possible that you just wrote a
bug, not that your use of X is flawed. But without the code, there's
no way anybody can know that.
Your bug, by the way, is creating an entirely new NSGraphicsContext
instead of using the current one. Replace the second line of your code
with:
[[NSGraphicsContext currentGraphicsContext] setPatternPhase:...]
And if that still doesn't work, come back and *post the code you're
using* so that the rest of us have more than a snowball's chance in
hell of figuring out what's going wrong.
Mike
DATE : Fri Jul 28 18:36:43 2006
On 7/28/06, Alan Smith <<email_removed>> wrote:
> Glenn -
> Yes. I tried that:
>
> NSPoint visOrigin = [self visibleRect].origin;
> [[NSGraphicsContext graphicsContextWithWindow: [self window]]
> setPatternPhase:NSMakePoint(visOrigin.x, visOrigin.y)];
> [[NSColor colorWithPatternImage: pattern] set];
> [NSBezierPath fillRect: [self bounds]];
>
> It doesn't have any affect. :(
And *this*, ladies in gentlemen, is a perfect showcase on why you need
to *post your code*.
~15 messages into the thread before we get any code, and it turns out
that the problem has nothing to do with the question being asked.
Whenever you say something like, "I tried X and it didn't work", post
the code that does X. It's entirely possible that you just wrote a
bug, not that your use of X is flawed. But without the code, there's
no way anybody can know that.
Your bug, by the way, is creating an entirely new NSGraphicsContext
instead of using the current one. Replace the second line of your code
with:
[[NSGraphicsContext currentGraphicsContext] setPatternPhase:...]
And if that still doesn't work, come back and *post the code you're
using* so that the rest of us have more than a snowball's chance in
hell of figuring out what's going wrong.
Mike






Cocoa mail archive

