• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Distinguishing clicks on NSSegmentedControl segments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Distinguishing clicks on NSSegmentedControl segments (From: m <email@hidden>)

  • Prev by Date: Frameworks within Frameworks
  • Next by Date: NSBrowser
  • Previous by thread: Distinguishing clicks on NSSegmentedControl segments
  • Next by thread: Re: Distinguishing clicks on NSSegmentedControl segments
  • Index(es):
    • Date
    • Thread