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

Using Momentary Tracking with NSSegmentedControl

The documentation for NSSegmentedControl says the following about using NSSegmentSwitchTrackingMomentary mode: A momentary segmented control sends an action when the user clicks a segment, and another action when the user releases the segment.…
Paige DePol
  • 1,121
  • 1
  • 9
  • 23
3
votes
1 answer

Adjust width and placement of NSSegmentedControl with dynamic in toolbar

I've got a pretty dynamic UI that uses a NSSegmentedControl in the toolbar of its document window. The NSSegmentedControl dynamically gets its elements assigned. The number of elements can vary widely between 1 and maybe 15. At the moment the…
ATV
  • 4,116
  • 3
  • 23
  • 42
3
votes
1 answer

Tinting a NSSegmentedControl... how?

I have a NSSegmentedControl that must be selected before the user can pass to the next phase in a wizard. I can disable the next button forcing the user to guess that something is missing but I would like to flash the control red, something like a…
Duck
  • 34,902
  • 47
  • 248
  • 470
3
votes
1 answer

How to adjust the height of NSSegmentControl?

The height of NSSegmentControl can't be adjusted. Is there anyone who knows how to do it? Please let me know. Many thanks.
larry761230
  • 197
  • 2
  • 7
3
votes
1 answer

NSSegmentedControl with bold, italic, and underlined segment

I'm trying to build a segmented control much like the Bold/Italic/Underline control in TextEdit. Is there a way to set a custom attributed string for each segment? [set attributedStringValue:] on the cell had no effect (there's no way to set per…
Mark
  • 6,647
  • 1
  • 45
  • 88
2
votes
2 answers

iOS-style on/off toggle button for NSButton?

Looking for a MacOS equivalent of the iOS on/off toggle button seen here: Is using an NSSegmentedControl the best option here?
Amit
  • 392
  • 2
  • 7
2
votes
1 answer

Xcode-like Navigator control

What type of control is this? Some sort of Segment control but without borders? It works like a menu in that you can mouse down and drag... it will highlight as you drag and pick the one you release on. How can I do something similar? The big…
Trygve
  • 1,317
  • 10
  • 27
2
votes
1 answer

NSSegmented Control Not Selecting

I have an NSSegmentedControl with the textured rounded style, and with the selection mode set to 'any'. The problem is that it is treating it like select none. When I switch the style to capsule, it works correctly. I am using this in a toolbar,…
Jared Pochtar
  • 4,925
  • 2
  • 29
  • 39
2
votes
2 answers

how to Customise the NSSegmentedControl font and background color

I want to customise the background colour and text color for NSSegmentedControl. There is option to do this for IOS but not found anything for OSX.
Raghav
  • 625
  • 1
  • 12
  • 31
2
votes
2 answers

How to center NSSegmentedControl

I've added an NSSegmentedControl to a pane on an horizontal split view on a normal window. I thought that adjusting the springs would make the segmented control centre itself automatically, but it doesn't. How can keep it centred? I was told to add…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
2
votes
1 answer

How can I set NSSegmentedControl background image?

I want to set the NSSegmentedControl background image not the icon image.I subclass the NSSegmentedCell and rewrite the drawSegment: inFrame: withView: function.But this works bad.How can I do that? update: I want to set the half rect dark or light…
gohamgx
  • 273
  • 2
  • 16
2
votes
0 answers

ITunes 11 new User Interface

Itunes 11 introduces a new UI-Element. It is an additional button row below the toolbar: One purpose of this new row is the replacement of NSSegmentedControls. How is it called and how would I build it with the Xcode Interface-Builder or by code.
2
votes
1 answer

NSSegmentedCell subclass drawing

I have created subclass of NSSegmentedCell and implemented drawWithFrame as following: #import "CustomSegmentedCell.h" @implementation CustomSegmentedCell - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { int i=0,…
AmitSri
  • 1,209
  • 1
  • 20
  • 48
1
vote
3 answers

Selecting the Tag of NSSegmentedControl

I'm attempting to implement an NSSegmentedControl button in my IB. I have it connected to - (IBAction)editCart:(id)sender; Also, it is connected to NSSegmentedControl *editCartButton; The first "segment" is a "-" button to decrease the cart…
D'Arcy Rail-Ip
  • 11,505
  • 11
  • 42
  • 67
1
vote
1 answer

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…
Pedro Vieira
  • 3,330
  • 3
  • 41
  • 76