Re: How to make target/action source in custom view?
Re: How to make target/action source in custom view?
- Subject: Re: How to make target/action source in custom view?
- From: Sam Griffith <email@hidden>
- Date: Wed, 03 Jul 2002 18:20:25 -0500
Stoney,
This link is about the target-action messages.
<
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/Programmi
ngTopics/ActionMessages/index.html#//apple_ref/doc/uid/10000067i>
I think your going to find thought that the target-action paradigm is for
NSControls (a subclass of NSView). So you might have to make your subclass
a subclass of NSActionCell or something like that. The target-action idea
is not a protocol that you can just implement anywhere it seems.
Hope this helps.
--
Sam Griffith Jr.
email: email@hidden
Web site:
http://homepage.mac.com/staypufd/index.html
On 7/3/02 5:38 PM, "Stonewall Ballard" <email@hidden> wrote:
>
I've seen this question asked in various groups, but the answers I've seen
>
don't work or seem wrong.
>
>
I have a subclass of NSView, and I want to make it possible for it to send
>
target/action messages to other objects, and use Interface Builder to drag
>
the connections.
>
>
It's easy to get "target" to show up as one of its outlets, but the outlet
>
is missing the little triangle that apparently indicates that I need to
>
select an action.
>
>
One answer I saw said that you had to add four methods to the custom class:
>
>
- (id)target
>
- (void)setTarget: (id)t
>
- (SEL)action
>
- (void)setAction: (SEL)s
>
>
but that didn't help.
>
>
Another answer said that my class had to be a subclass of NSControl. That
>
works, but there's way too much mechanism for this simple use, so it seems
>
wrong.
>
>
Is there a simpler way to enable this feature?
>
>
TIA,
>
>
- Stoney
_______________________________________________
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.