Trouble with NSSegmentedControl
Trouble with NSSegmentedControl
- Subject: Trouble with NSSegmentedControl
- From: Dave DeLong <email@hidden>
- Date: Mon, 16 Nov 2009 15:09:42 -0700
Hi everyone,
I'm having an issue with NSSegmentedControl. My control has two segments. Segment 0 has an image of NSAddTemplate, and segment 1 has an image of NSRemoveTemplate. Segment 0 is always enabled, and segment 1 is conditionally enabled. Segment 0 has a menu, segment 1 does not.
The behavior I'm expecting is this: When I click on segment 0, the menu is immediately show, and the action is not sent to the target. When I click on segment 1, the action is immediately sent to the target.
What I'm observing is that for both cells, the action is immediately sent to the target. Only when I click and hold on segment 0 does the menu show up.
However, I've found this line in some documentation: "Note also that if a segment contains a menu, the action message is not sent when [the NSSegmentedControl] is clicked." (very last sentence of this page: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/SegmentedControl/Articles/SegmentedControlCode.html)
How can I achieve the behavior that I'm looking for (and that is implied in the documentation)? Is there a way to set a different target and action for each segment?
Thanks,
Dave DeLong
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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