Re: Adding design-time 'live' functionality to IB palette items
Re: Adding design-time 'live' functionality to IB palette items
- Subject: Re: Adding design-time 'live' functionality to IB palette items
- From: Christopher Barnes <email@hidden>
- Date: Thu, 30 Jan 2003 23:24:38 -0800
Thanks for the first bit of info - can you tell me if I'm headed down the
right path here?
- I now have an object implementing the IBEditors protocol (a NSControl
subclass).
- When I double click my custom object on a NSWindow template, I can tell
the IBEditor is activating (as a test it's drawing a simple rectangle around
the control). Strangely enough, it calls -(void)closeEditor when this
happens.
Using mouseDown: I can move the IBEditor (as well as the edited object), and
(I'm assuming) pass any clicks through to the object to modify the
attributes I want, and have the object reflect these changes.
- However, when I deselect the object, the IBEditor doesn't seem to remove
itself from the view - the rectangle remains.
Any more tips would be appreciated.
Thanks again,
Chris
On 1/29/03 11:30 PM, "James DiPalma" <email@hidden> wrote:
>
> From: Christopher Barnes <email@hidden>
>
>
>
> What I want is something similar to NSTabView, where double-clicking
>
> the
>
> view causes the NSTabView to be selected, while single-clicking on a
>
> tab
>
> activates selects that particular NSTabViewItem.
>
>
What you are looking for is an "editor"; look at IBEditors.h for
>
methods that your editor should implement and in IBObjectProtocol.h for
>
this method:
>
>
- (NSString *)editorClassName;
>
>
Which can be put into a protocol on your object (or wherever you put
>
-inspectorClassName).
>
>
I don't think you'll find much documentation on getting an editor to
>
work, and its been a long time since I wrote NSTabView's editor, but
>
you can probably get something working. Start by getting your editor to
>
init and see what happens. If you want to open sub editors, also look
>
at IBDocument.h.
>
>
Good luck,
>
>
>
-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.