Re: Adding delegate connections to NSButton
Re: Adding delegate connections to NSButton
- Subject: Re: Adding delegate connections to NSButton
- From: Mike <email@hidden>
- Date: Mon, 02 Apr 2007 17:54:02 -0700
Actually that is not what I want to do. I have an NSView with a checkbox
in it. I don't care about getting notified when someone clicks the
checkbox because this is in a plugin with a defined architecture in
which one method in my class gets called repeatedly by the system
regardless of what I do to the code.
So each time I get called, I simply want to inspect the state of the
check box as being on or off. I have to do it in the method that gets
called by the system, not in my own message handler. It seems absurd to
me that I have to go through so many machinations just to get one value
from one control.
I am working with a copy of another plugin which has the same code but
NSTextEdit fields instead of an NSButton checkbox. I already have code
in the first plugin that gets the text of the edit fields. Now in the
second plugin I want to reuse the same code but just access the value of
the checkbox instead of the text of the edit fields.
Thanks,
Mike
Ricky Sharp wrote:
On Apr 2, 2007, at 5:21 PM, Mike wrote:
When I try to connected an NSButton like a switch to my object in IB,
no "delegate" connection shows up in the inspector window when I
control-drag to my object's instance.
Do only some types of controls (NSTextField) have delegates and other
(like NSButton) not?
Yes.
It sounds like you want to perform an action when the checkbox is
checked/unchecked. For that, look into creating an action outlet.
Or, if the checkbox's value simply needs to update some model's
attribute, look into using a binding.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden