Re: Using an NSView as a sheet
Re: Using an NSView as a sheet
- Subject: Re: Using an NSView as a sheet
- From: Eric Forget <email@hidden>
- Date: Fri, 26 Nov 2004 14:22:07 -0500
Hi,
A sheet is in fact a NSPanel which derives from NSWindow. So you can add
your view with something like:
NSView *contentView = [myWindow contentView];
[myView setFrameSize:[contentView frame].size];
[contentView addSubview:contentView];
There is just one gotcha you have take into account. A view cannot be
inserted in two view hierarchies at the same time. If it is what you need,
make sure you load the nib file two times.
Éric
> Is it possible to do this? I have a window (prefs) in one place that
> uses it as the content (using setContentView or something like it), and
> in another place I need it to come down from the login window as a
> sheet.
>
> Is there a way to do this? Otherwise it looks like two nibs and I guess
> two copies of the code (which I don't like).
>
> Advice, anyone?
___________________________________________________________________
Eric Forget Cafederic
email@hidden <http://www.cafederic.com/>
_______________________________________________
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