Re: InterfaceBuilder - Palletizing Windows
Re: InterfaceBuilder - Palletizing Windows
- Subject: Re: InterfaceBuilder - Palletizing Windows
- From: Alberto Ricart <email@hidden>
- Date: Wed, 6 Sep 2006 19:47:07 -0500
Thanks for the reply. Your solution doesn't work for many reasons:
1) NSWindow doesn't support NSCoding
2) IB handles windows differently from other things
[obviously it CAN do it, it is just the procedure is not documented,
as far as I can recall, it was the same way all the way back in
NeXTSTEP days]
I'll attempt some dumpster diving into the cocoa palette and see if I
see some interesting object in there.
Thanks,
/a
On Sep 4, 2006, at 8:16 PM, Ricky Sharp wrote:
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