Re: Drawing Directly onto an NSWindow
Re: Drawing Directly onto an NSWindow
- Subject: Re: Drawing Directly onto an NSWindow
- From: mw <email@hidden>
- Date: Fri, 29 Nov 2002 09:01:41 -0500
Okay, thanks for the information. However, I don't think that it will work
for me, given the method cocoa uses to place the image (tiling and
truncating). You see, I need to do this for a custom titlebar on a
borderless window, and the reason I have to draw it directly onto the window
is so the person can still drag by using the custom titlebar if they so
wish. It seems that the function you are using to set the background is
specifically for pattern images (because patterns are supposed to be tiled,
etc.). Perhaps there is another function that is specifically geared toward
non-pattern images?
Thanks again, though.
mw
>
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.