• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing Directly onto an NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: [repost] Using NSFontPanel in a prefPane ?
  • Next by Date: How unique is an Address Book ID?
  • Previous by thread: Re: Drawing Directly onto an NSWindow
  • Next by thread: Combo Box Problem
  • Index(es):
    • Date
    • Thread