Re: Drawing Directly onto an NSWindow
Re: Drawing Directly onto an NSWindow
- Subject: Re: Drawing Directly onto an NSWindow
- From: Fritz Anderson <email@hidden>
- Date: Thu, 28 Nov 2002 11:44:25 -0600
I put an image of my daughter, named Background.jpg (I renamed it for
the purpose, thank you very much), into the application bundle, and had
this in the window's controller:
@implementation Controller
- (void) awakeFromNib
{
NSImage * background = [NSImage imageNamed: @"Background"];
[myWindow setBackgroundColor: [NSColor colorWithPatternImage:
background]];
}
@end
The window's background is now the picture of my daughter instead of
the stripes. The image is not scaled; it is rooted to the lower-left
corner; it is truncated if it lacks room, and repeated if there is room
to spare.
As nothing else happened to the NSWindow, I assume event handling goes
on as before.
-- F
On Thursday, November 28, 2002, at 08:58 AM, mw wrote:
Is there any way to draw an NSImage (retrieved from the main bundle)
directly onto a window so that the window still receives the normal
mouse
events (instead of using an NSView and blocking the window from getting
events such as mouseEnter and mouseDrag)?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.