NSSegmentedControl Quick Question.

Hi

I’m struggling to connect a NSSegmentedControl up in interface builder, i was just wondering if i was missing something or its just something i would have to write in code to make it work.

Its a 2 Segment button with a plus and a minus just for adding and deleting, i can connect one up like a normal button but i can’t connect the other one up without it deleting the other connection.

Any ideas.

Cheers

it may have several segments, but it only has one action. From the docs: " When any segment in the control is clicked, the action message is sent to the target”unless the segment is disabled or has a menu. You can determine which segment was clicked by finding the tag for the selected segment". And: “Note that the cell’s selectedSegment method returns the segment that was last clicked.”

Thanks Shane!

I thought it was looking that way but wanted to double check just in case i was missing something.

I was working on such a button and finally wrote:

on MultSegClicked_(anObject)
	set num to anObject's selectedSegment() -- num returns the segment which was clicked.
            ...
end MultSegClicked_