Questions tagged [nssegmentedcontrol]

An NSSegmentedControl object implements a linear set of two or more segments, each of which functions as a button. It is available in OS X v10.3 and later. It is declared in Apple's AppKit framework

The NSSegmentedControl class uses an NSSegmentedCell class to implement much of the control's functionality. Most methods in NSSegmentedControl are simply cover methods that call the corresponding method in NSSegmentedCell.

The methods of NSSegmentedCell that do not have covers relate to accessing and setting values for tags and tool tips, programmatically setting the key segment, and establishing the mode of the control.

Source: NSSegmentedControl class reference

68 questions
1
vote
1 answer

Swift 5 Segmented Control Truncates the Titles

I am using dynamic segmented control. Whenever user adds new decks, the title is showing up in the segmented control. However, I need a horizontally scrollable segmented controller that might have different title width depending on the text (title)…
1
vote
1 answer

Is there a way to use .selectedSegmentIndex instead of .buttons["name"] in UITest?

When doing my element query in my UITests, to take screenshots of the different segmented control value, an error is thrown when translation comes into play because I use .buttons["name"], and the name is in English and is not being translated as…
1
vote
2 answers

How can I set the appearance of my NSSegmentedControl to match the one of Xcode?

On Xcode the buttons in the top right corner look like this, depending on their selected state: I try to replicate it and set the images in my NSSegmentedControl but I only get this I have played with segButtons.selectedSegmentBezelColor =…
Thomas
  • 8,306
  • 8
  • 53
  • 92
1
vote
1 answer

How can I round the corners of only one side of an NSButton in Swift 4?

I am new to Swift and Stack Overflow in general, so I hope I'm not asking much to bear with me. I am trying to achieve a 'grouped' button style that can be found on Finder or in the XCode editor toolbar, like these two button groups. As you can see…
ta5een
  • 13
  • 1
  • 2
  • 5
1
vote
1 answer

Swift macOS SegmentedControl Action not getting called

Description I am trying to use NSSegmentedControls to transition between Child ViewControllers. The ParentViewController is located in Main.storyboard and the ChildViewControllers are located in Assistant.storyboard. Each ChildViewController has a…
726F6F74
  • 26
  • 3
1
vote
2 answers

How to properly set an NSSegmentedControl enabled

I'd like to have my NSSegmentedControl with a segment selected when enabled and with no segment selected while disabled (the kind of behavior that the view NSSegmentedControl in iTunes has). Here some images: enabled and selected disabled…
rano
  • 5,616
  • 4
  • 40
  • 66
1
vote
0 answers

Get NSButtons in NSSegmentedControl in OSX

I am struggling with accessibility for NSSegmentedControl on OSX. I want to add accessibility labels to individual segments in NSSegmentedControl. When I turn on Voice over I see that the voice over detects these segments as radio buttons. However I…
1
vote
1 answer

NSSegmentedControl segments selectable event though disabled

I have a NSSegmentedControl in a toolbar. Its mode is set to "momentary" because the segments should appear to work like buttons, not like permanent selections. The rules for enabling: When content is selected, all 3 segments should be enabled.…
ctietze
  • 2,805
  • 25
  • 46
1
vote
0 answers

Clicking NSSegmentedControl in unselected NSTableView row always produces -1 as output

Sample project: https://drive.google.com/file/d/0B_fZh7kpxha7Y0JfU0xYMGpiMVE/view?usp=sharing If you select a table row then select segments in the NSSegmentedCell, you can see in the log that the correct output is being produced. However, if you…
Lorenzo
  • 1,605
  • 14
  • 18
1
vote
2 answers

Using NSSegmentedControl with CoreData

I have a Core Data app that works to add or remove one of a Client's many Appointments with buttons bound in IB to my appointments ArrayController. The appointments content is derived from whichever Client is selected in a feed list. I wish to use…
1
vote
2 answers

NSSegmentedControl programmatically highlight segment

I have a NSSegmentedControl in which, upon user's click, some conditions should be met before the action is sent to its target. Till now i managed to do this, by overriding the -mouseDown event handler and invoking the segmentedControl's [super…
user4096537
1
vote
1 answer

NSSegmentedControl - Is there a way to attach an (id) representedObject to each NSSegmentedCell part of the control?

Have an NSSegmentedControl and I am trying to attach different representedObject's to each NSSegmentedCell. I think I may be doing something incorrectly because it does not appear to be working. [mySegmentedControl…
skålfyfan
  • 4,931
  • 5
  • 41
  • 59
1
vote
1 answer

Cannot add more elements to NSSegmentedControl

I have this NSSegmentedControl created on interface builder and saved on a xib file. The control has initially 4 segments. If I use this [self.myControl setSegmentCount:6]; to increase the number of segments to 6, programmatically, it will not work…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
1 answer

NSSegmentedControl within tool bar like Xcode 4

I would like to implement a NSSegmentedControl like those in the XCode 4 toolbar (View or Editor). I don't manage to adjust an image within it and I can not set up the frame using Interface Builder. What is the best strategy to follow ?
yageek
  • 4,115
  • 3
  • 30
  • 48
1
vote
1 answer

Controlling NSSegmentedControl with the keyboard

I have a form in my Cocoa app that contains an NSSegmentedControl that I want to be controllable via the keyboard. It seems that NSSegmentedControl is very reluctant to become the first responder, however. Setting the initial first responder of the…
jlong64
  • 928
  • 10
  • 13