Re: Subclassing NSButton, and IB palettes
Re: Subclassing NSButton, and IB palettes
- Subject: Re: Subclassing NSButton, and IB palettes
- From: James DiPalma <email@hidden>
- Date: Sun, 14 Jul 2002 10:17:18 -0400
On Wednesday, July 10, 2002, at 04:36 PM, Simon Fraser wrote:
However, it seems IB doesn't make it easy to create UI for
appending data to existing classes; I can make an IB palette
for MyPrefsButton, but, even through it inherits from NSButton,
IB just shows my panel, and doesn't seem to have a way to
show the existing NSButton panel. Do I really have to implement
panel UI to set all of the properties of the superclass?
Look at IBInspectorManager.h (inside InterfaceBuilder.framework) for
these:
+ (IBInspectorManager *)sharedInspectorManager;
- (void)addInspectorModeWithIdentifier:(NSString *)identifier
forObject:(id)object localizedLabel:(NSString *)label
inspectorClassName:(NSString *)inspectorClassName
ordering:(float)ordering;
IB_EXTERN NSString * const IBWillInspectObjectNotification;
Listen for IBWillInspectObjectNotification and use [super
inspectorClassName] for inspectorClassName. Then NSButton's attributes
inspector will be added to your object's list of inspectors. If you want
NSButton's inspector to be your attributes inspector, then use your
object's new attributes inspector class as inspectorClassName and don't
override inspectorClassName.
Hope that helps.
-jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.