Re: NSWindow's setContentView
Re: NSWindow's setContentView
- Subject: Re: NSWindow's setContentView
- From: Drarok Ithaqua <email@hidden>
- Date: Mon, 19 Jun 2006 20:41:54 +0100
On 19 Jun 2006, at 4:35 pm, Shawn Erickson wrote:
Something is likely wrong in how you are swapping things around (or
a bug in the framework but those happen very seldom). I move views
between windows all the time (just need to make sure you are moving
the correct view... some items you drop from IB into a nib are in
fact contained in a parent view... say a scroller view).
After much confusion and testing with other Views, it seems to be a
very small issue with NSMovieView, but I've also found the workaround.
With one of the other views I was testing with, [mainWindow
setContentView:theView]; worked perfectly as expected, but with
NSMovieView, it resized the view correctly, but still displayed it
inside the original window!
I solved it like so:
[movieView retain];
[movieView removeFromSuperview]; // This is the line that fixes all.
[mainWindow setContentView:movieView];
[movieView release];
After that, it all looks right. The movieView's retainCount stays
level at 2. Awesome!
_______________________________________________
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