Re: How to draw background image in my app window

2009-06-01 Thread cocoa learner
On Sun, May 31, 2009 at 9:37 PM, Andy Lee wrote: > On May 31, 2009, at 8:51 AM, Uli Kusterer wrote: > > Another approach would be to try changing the class of your content view in > Interface builder. Simply click the background of the window, that should > show the content view in the inspector.

Re: How to draw background image in my app window

2009-05-31 Thread Andy Lee
On May 31, 2009, at 8:51 AM, Uli Kusterer wrote: Another approach would be to try changing the class of your content view in Interface builder. Simply click the background of the window, that should show the content view in the inspector. Go to the "Identity" tab and change the class to NSIm

Re: How to draw background image in my app window

2009-05-31 Thread Uli Kusterer
Am 30.05.2009 um 19:45 schrieb cocoa learner: Yah Andy and Michael you all were right. But still I have some problem.1>. While resizing the window Image is not getting resized. You could probably fix that using setImageScaling: on the image view. 2>. My controls (NSButton and NSTextField)

Re: How to draw background image in my app window

2009-05-30 Thread M Pulis
No, the conclusion is : That _is_ the easy and straight way to do it. Subclassing is your power and friend, my friend. Once you understand what those lines actually do, you should have a different point-of-view. "Embrace the subclass, for they know what they are doing." :-) gary On May 30,

Re: How to draw background image in my app window

2009-05-30 Thread cocoa learner
Ok. Let me try this.So conclusion is there is no easy and straight way to do it. Have to subclass NSView. Thanx Michael. Cocoa.learner On Sun, May 31, 2009 at 1:12 AM, Michael Vannorsdel wrote: > You'd really be better off making an NSView subclass and having it draw the > image you want in draw

Re: How to draw background image in my app window

2009-05-30 Thread Michael Vannorsdel
You'd really be better off making an NSView subclass and having it draw the image you want in drawRect:. - (void)awakeFromNib { myImage = [[NSImage alloc] init [self setNeedsDisplay:YES]; } - (void)drawRect:(NSRect)rect { NSSize isize = [myImage size]; [myImage dr

Re: How to draw background image in my app window

2009-05-30 Thread cocoa learner
rce:@"winImg" ofType:@"png"]; >> >> NSLog(@"AppController::init : Image file path : %@", path); >> >> NSImageView *winContent = [[NSImage alloc] initWithContentsOfFile:path]; >> >> [ appWindow setContentView: winContent]; >>

Re: How to draw background image in my app window

2009-05-30 Thread Michael Vannorsdel
oa.learner. On Tue, May 26, 2009 at 11:12 PM, Nick Zitzmann 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,

Re: How to draw background image in my app window

2009-05-30 Thread Andy Lee
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 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 win

Re: How to draw background image in my app window

2009-05-30 Thread cocoa learner
ong in this code? Regards Cocoa.learner. On Tue, May 26, 2009 at 11:12 PM, Nick Zitzmann 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 -setC

Re: How to draw background image in my app window

2009-05-26 Thread Nick Zitzmann
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 co

How to draw background image in my app window

2009-05-26 Thread cocoa learner
Hi all, How to draw background image in my app window? I have found a way but not sure whether that's correct. So here is my way of doing - 1>. Get a window from IB Library. 2>. Drag NSImage item from IB Library on window. 3>. Make it the size of window. 4>. Now drag and drop t