• 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: How to draw background image in my app window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to draw background image in my app window


  • Subject: Re: How to draw background image in my app window
  • From: cocoa learner <email@hidden>
  • Date: Sat, 30 May 2009 20:27:21 +0600

Thanx Nick for your reply.But in my window I am not getting the image I want
to display. Here is my code -

- (id) init

{

[super init];

NSLog(@"AppController::init : Setting the windows content");

NSBundle *myBundle = [NSBundle mainBundle];

if (myBundle == NULL)

{

NSLog(@"AppController::init : myBundle is NULL");

}

else

{

NSLog(@"AppController::init : myBundle is not NULL");

}

 NSString *path = [myBundle pathForResource:@"winImg" ofType:@"png"];

 NSLog(@"AppController::init : Image file path : %@", path);

NSImageView *winContent = [[NSImage alloc] initWithContentsOfFile:path];

 [ appWindow setContentView: winContent];

 NSLog(@"AppController::init : The windows content has been set");

return self;

}

I can see all the logs. But not the image in back ground of my app window.
Am I doing any thing wrong in this code?

Regards
Cocoa.learner.


On Tue, May 26, 2009 at 11:12 PM, Nick Zitzmann <email@hidden> wrote:

>
> On May 26, 2009, at 11:04 AM, cocoa learner wrote:
>
>  How to draw background image in my app window?
>>
>
> You could change the window's content view using -setContentView: to a view
> that will draw a background image, such as NSImageView... Of course, if you
> have any other controls in the content view that is being replaced, then
> they'll be lost.
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
>
>
>
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to draw background image in my app window
      • From: Michael Vannorsdel <email@hidden>
    • Re: How to draw background image in my app window
      • From: Andy Lee <email@hidden>
References: 
 >How to draw background image in my app window (From: cocoa learner <email@hidden>)
 >Re: How to draw background image in my app window (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Modeling "Smart Playlists"
  • Next by Date: Re: Message from view to viewController
  • Previous by thread: Re: How to draw background image in my app window
  • Next by thread: Re: How to draw background image in my app window
  • Index(es):
    • Date
    • Thread