Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing Directly onto an NSWindow



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.

References: 
 >Drawing Directly onto an NSWindow (From: mw <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.