Re: Custom IB palette: Is there a way to use parent's IB inspector and also add new features to it?
Re: Custom IB palette: Is there a way to use parent's IB inspector and also add new features to it?
- Subject: Re: Custom IB palette: Is there a way to use parent's IB inspector and also add new features to it?
- From: "E. Wing" <email@hidden>
- Date: Tue, 6 Jun 2006 23:28:20 -0700
Thanks! That seemed to do the trick.
Thanks,
Eric
On 6/6/06, Ricky Sharp <email@hidden> wrote:
On Jun 6, 2006, at 8:12 PM, E. Wing wrote:
> I'm playing around with the sample code from the Developer Connection
> called "Reducer". It provides a custom palette containing among
> things, an AnimatingTabView. It has it's own IB inspector which lets
> you control which Core Image transition you want to use. However, you
> lose access to the standard NSTabView attributes in the process.
> Playing with it, I some how managed to get back to the parent
> attributes, but then I lost out on all the new AnimatingTabView
> attributes.
One thing you could do is have AnimatingTabView implement a
protocol. Methods on the protocol would be the accessors for the
additional attributes the subclass would have. Then, in your
palette's willInspectObject: method, do something like this:
- (void)willInspectObject:(NSNotification*)aNotification
{
id theObject = [aNotification object];
if ([theObject conformsToProtocol:@protocol(YourSpecialProtocol)])
addInspectorModeWithIdentifier:@"Animation Attributes"
forObject:theObject
localizedLabel:@"Some label"
inspectorClassName:@"YourCustomInspectorClass"
ordering:-1.0];
}
You then do _not_ implement the inspectorClassName method on the
AnimatingTabView.
So, whenever an instance of AnimatingTabView is selected in IB, you
should then see the NSTabView inspector and then gain an additional
inspector pane (appended to the end of popup menu item list; hence
the -1.0 ordering) to handle the additional animation attributes.
I went down this protocol route to add custom "supplemental"
inspector panes for a custom help tag implementation and speech
recognition integration.
___________________________________________________________
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