Re: InterfaceBuilder - Palletizing Windows
Re: InterfaceBuilder - Palletizing Windows
- Subject: Re: InterfaceBuilder - Palletizing Windows
- From: Ricky Sharp <email@hidden>
- Date: Mon, 4 Sep 2006 20:16:57 -0500
On Sep 4, 2006, at 6:49 PM, Alberto Ricart wrote:
I know that this has been discussed previously but I am yet to to
see a solution. Is there a way of palletizing an NSWindow/NSPanel.
Our window draws its own background, and we want to make it easy to
create windows of this kind without adding code specific to the
window type.
First, pleast don't cross-post.
I haven't yet done this myself, but I think the following will work:
@interface YourPalette : IBPalette <IBViewResourceDraggingDelegates>
{
@protected
IBOutlet NSImageView* yourWindowProxy;
YourWindow* yourWindow;
...
}
Then in the implementation...
- (void)finishInstantiate
{
yourWindow = [[[YourWindow alloc] initWithThisAndThat...
[self associateObject:yourWindow ofType:IBWindowPboardType
withView:yourWindowProxy];
}
I believe the key thing here is using IBWindowPboardType. Note that
you use IBViewPboardType for views (controls, etc.)
In your palette's nib, put an NSImageView to represent your window
object (assign to yourWindowProxy outlet). You should then be able to
drag these windows/panels to nibs from your palette.
Add in a custom inspector, and you're all done.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.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