Re: Newbie with stupid question
Re: Newbie with stupid question
- Subject: Re: Newbie with stupid question
- From: email@hidden
- Date: Sun, 17 Mar 2002 23:37:26 -0800
I have an action and outlet set up from a checkbox to several
slidders. I
want it so that when you click the checkbox off (it defaults to checked)
that the action will go to the controller, then that go to several
outlets
connected to those slidders. The controller will tell the slidders to
become enabled (they default to disabled). So what would I put in the
action checkBox1Clicked? This is something like what I want:
If(self clicked) //I don't know what to say for clicked, value is 1?
[gamma enabled:TRUE]; //gamma is one of the slidders
else
[gamma enabled:FALSE];
[gamma setEnabled:([sender state] == NSOnState) ? YES : NO];
Note you probably want to use "sender", where sender is the sender of
the action (i.e. the NSButton for the checkbox), not "self", which would
be the object that is the target of sender's action -- typically some
controller object, as you say.
The documentation you want to be looking at for this information is
NSControl and NSButton. However, you are forgiven if you find that doc
somewhat confusing; these classes have suffered more than most from the
repeated revisions of the UI and changes of architecture, and contain a
good deal of cruft.
Good luck...
Ben Haller
Stick Software
_______________________________________________
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.