Re: Fixed pattern with colorWithPatternImage

2010-09-06 Thread Daniel Lopes
If I pass nil only the left part is filled. Which I think is right. See the image above: http://cl.ly/2HPb Daniel Lopes On Mon, Sep 6, 2010 at 2:21 PM, Ken Ferry wrote: > It's legal to pass nil for the left and right caps if you don't have any, > which apparently you do not. > > -Ken > > > On

Re: Fixed pattern with colorWithPatternImage

2010-09-06 Thread Ken Ferry
It's legal to pass nil for the left and right caps if you don't have any, which apparently you do not. -Ken On Mon, Sep 6, 2010 at 10:09 AM, Daniel Lopes wrote: > Perfect, I did this: > > - (void)drawRect:(NSRect)dirtyRect { > > NSImage *pattern = [NSImage imageNamed:@"TitlePattern.png"]; >

Re: Fixed pattern with colorWithPatternImage

2010-09-06 Thread Daniel Lopes
Perfect, I did this: - (void)drawRect:(NSRect)dirtyRect { NSImage *pattern = [NSImage imageNamed:@"TitlePattern.png"]; NSDrawThreePartImage([self bounds], pattern, pattern, pattern, NO, NSCompositeSourceOver, 1, NO); } Thanks again. Daniel Lopes On Sun, Sep 5, 2010 at 10:04 PM, Danie

Re: Fixed pattern with colorWithPatternImage

2010-09-05 Thread Daniel Lopes
Thanks everybody. I'm without my mac now, so I will try all the recomendations tomorrow, anyway... big thanks for all help (until now I didnt found a good a place where I can have help to learn Cocoa for Mac, and not iPhone). Sent from my iPad On 05/09/2010, at 19:42, Ken Ferry wrote: > > >

Re: Fixed pattern with colorWithPatternImage

2010-09-05 Thread Ken Ferry
On Sun, Sep 5, 2010 at 3:41 PM, Ken Ferry wrote: > > > On Sat, Sep 4, 2010 at 1:16 PM, Daniel Lopes wrote: > >> Hello Quincey, >> >> Thanks, I thought that a simple thing like that could be done easier. My >> background is from web dev (specially Ruby). >> > > NSDrawThreePartImage looks like it s

Re: Fixed pattern with colorWithPatternImage

2010-09-05 Thread Ken Ferry
On Sat, Sep 4, 2010 at 1:16 PM, Daniel Lopes wrote: > Hello Quincey, > > Thanks, I thought that a simple thing like that could be done easier. My > background is from web dev (specially Ruby). > NSDrawThreePartImage looks like it should be very easy in this case. In fact, it looks like you do h

Re: Fixed pattern with colorWithPatternImage

2010-09-05 Thread James Montgomerie
On 04/09/2010, at 14:52, Quincey Morris wrote: > The pattern is tiled relative to the window, not to the view. So, the > 'colorWithPatternImage:' isn't a viable approach in this case. Quincey may be right that drawing the image directly is the easier approach, but it /is/ possible to change th

Re: Fixed pattern with colorWithPatternImage

2010-09-04 Thread Daniel Lopes
Hello Quincey, Thanks, I thought that a simple thing like that could be done easier. My background is from web dev (specially Ruby). That app is just a simple pet project and for that I will use a simple gradient instead of the image. I tried the image because I want a small noise instead of a

Re: Fixed pattern with colorWithPatternImage

2010-09-04 Thread Quincey Morris
On Sep 4, 2010, at 10:13, Daniel - Area wrote: > My code is basically this: > http://pastie.org/1138167 > > a) Looking my code I think the issue is exactly what you said. But > what is the right object and properties to access the full size of the > view? No, what I said is not the problem. You'

Re: Fixed pattern with colorWithPatternImage

2010-09-04 Thread Daniel - Area
Hey Quincey, thanks to answer. My code is basically this: http://pastie.org/1138167 a) Looking my code I think the issue is exactly what you said. But what is the right object and properties to access the full size of the view? b) If is not ask too much, that way I'm trying to acheive the layout

Re: Fixed pattern with colorWithPatternImage

2010-09-03 Thread Quincey Morris
On Sep 3, 2010, at 13:16, Pessoal wrote: > I have a custom view called HeaderView and I need to draw a pattern in this > view. The final result that I want to achieve is this: > http://cl.ly/2F5q > > And it's working but when I resize the window and my drawRect is called the > pattern change his

Fixed pattern with colorWithPatternImage

2010-09-03 Thread Pessoal
Hello, It's my first post here and I'm starting with Cocoa (OSX, not iPhone yet). I'm working in a small project that need some customizations in the UI. I have a custom view called HeaderView and I need to draw a pattern in this view. The final result that I want to achieve is this: http://cl.l