programmatically implementing segmented control
programmatically implementing segmented control
- Subject: programmatically implementing segmented control
- From: Daniel Child <email@hidden>
- Date: Tue, 12 Feb 2008 13:58:20 -0500
Hi All,
I am looking for to programmatically set up an NSSegmentedControl
with menus for each segment.
I use a function to populate a menu with string equivalents to an
enumerated set of values.
I append the items to the menu, and append the menu to the control
segments.
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.
I am admittedly not clear on how to field the user choice. When the
user selects, say, segment 1 item 2, is it the menu item that sends
an action message? Or should be there delegation from the menu itself
to the controller to notify that something has happened?
Sorry if this is basic. I've looked at the guides on
NSSegmentedControl / NSSegmentedCell / NSMenu but can't see why this
is happening. If anyone knows of a good tutorial on this kind of
programmatic menu setup, I'd love to know about that too.
Thanks.
Daniel
_______________________________________________
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