Re: programmatically implementing segmented control
Re: programmatically implementing segmented control
- Subject: Re: programmatically implementing segmented control
- From: Jerry Krinock <email@hidden>
- Date: Tue, 12 Feb 2008 12:25:43 -0800
On 2008 Feb, 12, at 10:58, Daniel Child wrote:
I am looking for to programmatically set up an NSSegmentedControl
with menus for each segment.
That should look interesting!
When I run the program, the menu does appear correctly for each
segment, but the problem is that all the items are disabled. I tried
using -setEnabled when creating each of the menu items, but that
didn't work. I also set the action to @selector (getUserChoice), a
method in the controller code.
All the working actions I've ever seen have one argument. As you have
written it, "getUserChoice" has 0 arguments. "getUserChoice:" (note
the colon) has one argument. The full declaration is -
(IBAction)getUserChoice:(id)sender.
Another thing which can cause menus to not be enabled is if you've
implemented -validateMenuItem: or -validateUserInterfaceItem: in some
object in the responder chain which is returning NO for unknown items.
Finally, remember to -setTarget: in your menu items.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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