Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
I've decided to go with the textured NSWindow simply because it looks so good for my intended app.

However, the default metalic-looking texture seems to be non-editable, and all edits you can do to the window seems to be to change its backgroundcolor.

This would be ok if the backgroundcolor did have the same shadow-effects as the default texture, but it doesnt and looks plain and boring.

I've been thinking about workarounds, like making a whole new custom view, but before getting to that, is there anything I'm missing as to how to customize the background of a textured window? Is there a simpler way to get that same look but with another color, or is there a way to actually set the background texture?
 
Try this:
Code:
- (void)awakeFromNib
{
myImage = [[NSImage alloc] init]

[self setNeedsDisplay:YES];
}

- (void)drawRect:(NSRect)rect
{
NSSize isize = [myImage size];
[myImage drawInRect:[self bounds] fromRect:NSMakeRect(0.0, 0.0,
isize.width, isize.height) operation: NSCompositeCopy fraction:1.0];
}
 
I keep getting this type of error:

Code:
incompatible type for argument 1 of 'drawInRect:fromRect:operation:fraction:

..for the line..

Code:
[img drawInRect:[self bounds] fromRect:NSMakeRect(0.0, 0.0, isize.width, isize.height) operation: NSCompositeCopy fraction:1.0];
 
I keep getting this type of error:

Code:
incompatible type for argument 1 of 'drawInRect:fromRect:operation:fraction:

..for the line..

Code:
[img drawInRect:[self bounds] fromRect:NSMakeRect(0.0, 0.0, isize.width, isize.height) operation: NSCompositeCopy fraction:1.0];

What type is self?

That is, what is the type of the class this code is in? Is it a view with a bounds method?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.