Re: Distinguishing clicks on NSSegmentedControl segments
Re: Distinguishing clicks on NSSegmentedControl segments
- Subject: Re: Distinguishing clicks on NSSegmentedControl segments
- From: Scott Anguish <email@hidden>
- Date: Thu, 25 Dec 2003 02:15:17 -0500
On Dec 24, 2003, at 11:34 PM, m wrote:
>
I want a segmented control using tracking mode
>
NSSegmentSwitchTrackingMomentary (like the forward/backward buttons in
>
Safari). When the user clicks on one of the segments, the action that
>
I assigned to the control is being called.
>
>
So far so good.
>
>
Now the fun part: how do I determine which segment the user clicked
>
on? Setting tags for the segments (using NSSegmentedCell's
>
setTag:forSegment: method) is useless, since there is nothing like a
>
"tagForMostRecentlyClickedSegement" method.
>
>
What am I missing?
>
I'd suggest setting the action/target on the NSSegmentedCell rather
than the NSSegmentedControl. Then you can set a different action for
each, and you'll also get the cell as the sender, so you can query the
[sender tag] to see what the tag is.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.