cocoatextlabelcellsnssegmentedcontrol

From a NSSegmentedControl to a label


I'm new to Mac Programming, but i'm having some ideas for an application. My question is: i have a NSSegmentedControl with 2 cells and i wanted to, if the cell number 1 is selected, write something on a label with, for example, a blue color. How can i do this? i'm sorry if this was already asked :/


Solution

  • You can find out which element is selected from the selectedSegment.

    http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSSegmentedControl_Class/Reference/Reference.html