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.
- When no content is selected, only the last one should be enabled.
So I cannot disable the whole control but only some segments.
let enabled = hasSelection()
AddDimensionSegmentedControl.contextualSegments // = (0...1)
.forEach { (segment: Int) in
self.setEnabled(enabled, forSegment: segment)
}
That works quite well so far:
But I can still click on disabled segments and have them selected even though that's not the selection mode
What I tried:
- when the selection changes, deselect the segment again
- when the toolbar validates, set
selectedSegment = -1
Still the disabled-looking selection stays in tact. Any ideas?