Re: NSWindow and NSImageView
Re: NSWindow and NSImageView
- Subject: Re: NSWindow and NSImageView
- From: Francesca P <email@hidden>
- Date: Fri, 21 Oct 2005 09:34:18 +0200
I recommend you test it and see! :) But yes, I think that will do
it. Or you could try
[[myWindow contentView] addSubview:myImage];
(because by default a window has a plain NSView already as its
content view) or even
[myWindow setContentView:myImage];
But the last option is no good if you might want to put other
things in the window.
--Andy
Ok,
this is my code:
NSWindow *finestrazo = [[NSWindow alloc] initWithContentRect:retta
styleMask:(NSResizableWindowMask | NSClosableWindowMask)
backing:NSBackingStoreBuffered defer:NO];
[finestrazo makeKeyAndOrderFront:self];
img=[[NSImage alloc] initWithContentsOfFile:(nomeimmagine)];
[imgLarge setImage:img];
[finestrazo setContentView:imgLarge];
This code is ok. It works.
But, now I have a new problem.
I want open more istances of my window.
So I open various window.
But when I display the new image in the new window, in the first
window the image disappear.
This is caused by setContentView that delete the previous view... and
I've to retain it... I've read it in the documentation.
But I'm newbie and I don't know how I have to do..
Now I'm trying.. if someone has any suggest.......
thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden