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
0
votes
2 answers

subclassing nssegmentedcontrol?

What's the best way to create controls like this? I'm assuming it's an NSSegmentedControl and I have to subclass the cell? But wanted to get a second opinion. Thanks, rc Note: the lighter control is from Twitter Mac and the darker are from…
rick
  • 451
  • 3
  • 13
0
votes
2 answers

Strange drawing behavior of NSSegmentedControl, when superview is drawn

I've got a problem with the NSSegmentedControl. I have a custom view where I draw a gradient with a shadow. The drawing is ok, but when I place a NSSegmentedControl inside it then something strange happens - the background of the custom view is…
Kai Engelhardt
  • 1,272
  • 13
  • 17
0
votes
0 answers

NSToolbar segmented control like finder

I'm updating and older macOS Application using newer NSToolbar feature like using NSSearchToolbarItem instead of manually creating it by setting the view of NSToolbarItem to NSSearchField. Currently the same is done for a NSToolbarItem containing a…
Deitsch
  • 1,610
  • 14
  • 28
0
votes
2 answers

Autolayout: conditional content compression resistance priority using NSUserInterfaceCompression

I've created a custom segment control (Cocoa / macOS) by subclassing NSView (does not use any existing controls / buttons; it's an entirely custom view with a complex set of internal constraints) that has two modes: Displays all segments…
strangetimes
  • 4,953
  • 1
  • 34
  • 62
0
votes
1 answer

Replicate segmented cell style of macOS Big Sur

I am trying to replicate the style of the Finder. I have a NSSegmentedControl that is hosted in the menu bar, however, the style is a little bit different. This is how the finder looks like: And this is how my NSSegmentedControl looks like: The…
inexcitus
  • 2,471
  • 2
  • 26
  • 41
0
votes
1 answer

How can I recreate this same Angular Material toggle selection code using HTML and CSS?

I am trying to add this (https://stackblitz.com/edit/historical-toggle-p82shy?file=src%2Fapp%2Fbutton-toggle-overview-example.html) to my Angular project, but having issues styling it in css. Is it because I can't overwrite the defaults? I found…
0
votes
1 answer

Muddy text when dragging NSSegmentedControl

I have an NSSegmentedControl within a draggable view (This is a much simplified test case to demonstrate the problem). When first created everything looks ok as in this image: The view with the light green background is draggable. If I drag it…
northernman
  • 1,446
  • 16
  • 19
0
votes
0 answers

How to add text to segmented control in macOS so that it shows up in toolbar in text only mode?

How to add text to segmented control in macOS so that it shows up in toolbar in text only mode? Currently I am created the control like let tabbar = NSSegmentedControl(labels: ["One", "Two", "Three"], trackingMode: .selectOne, target: self, action:…
John Doe
  • 2,225
  • 6
  • 16
  • 44
0
votes
1 answer

NSSegmentedControl - Odd appearance when placed in blur view

I have a macOS app with a simple popover view and a NSSegmentedControl placed within it. Everything works fine, apart from the odd appearance of the segmented control. It has this weird square background when placed in the pop over view. Is there…
Supertecnoboff
  • 6,406
  • 11
  • 57
  • 98
0
votes
1 answer

Saving title of NSSegmentedControl in User defaults

Thanks for the help: I manually set the title of a segController segment from a textField input like this: NSString *labelString = [textField stringValue]; (textField.stringValue = labelString); [segControl setLabel: labelString forSegment:8]; I…
Paul
  • 234
  • 2
  • 10
0
votes
1 answer

NSSegmentControl Images Scaling Not Working

The problem appears specifically when using an NSSegmentControl and in the segments inside images are placed (set via StoryBoard). Furthermore it only happens when using a Retina MacBook and if you're NOT connected to a second monitor. When the…
MMV
  • 297
  • 2
  • 9
0
votes
0 answers

Can I change the NSSegmentedControl popup menu position?

I am using a 3 segment NSSegmentedControl for adding and removing configurations, as well as the cog "action" symbol to pop up a menu. However, when the menu pops up it shows up as follows: I would much prefer the popup to be displayed centered…
Paige DePol
  • 1,121
  • 1
  • 9
  • 23
0
votes
0 answers

RACSignal from NSSegmentedControl's selectedSegment property

A NSSegmentedControl instance is bound to a ViewController as @property (weak) IBOutlet NSSegmentedControl *mySegmentedControl; In the viewDidLoad method, a signal is created (and subscribed to) for the selectedSegment property of the…
0
votes
3 answers

NSSegmentedControl -selectedSegment always returns 0

I have an NSSegmentedControl with two segments set to "Select None" mode in Interface Builder. No matter what I try, I can't get -selectedSegment to return anything but 0, even though segment 0 is even disabled by default and can't possibly be…
vilhalmer
  • 1,149
  • 3
  • 11
  • 23
0
votes
1 answer

NSSegmentedControl image default size?

What is the recommended size for NSSegmentedControl segment image? - (void)setImage:(NSImage *)image forSegment:(NSInteger)segment I'm currently using 26x26 PNG image and it looks blurry. What I want is :
Jun
  • 3,422
  • 3
  • 28
  • 58