Pregunta

I'm trying to discern what kind of control is used in Xcode for the Navigator pane on the left hand side (see image below).

Xcode Navigator Header

Essentially, this functions as a segmented control but the style differs from the standard NSSegmentStyle enums.

Is this a UISegmentedControl subclassed to do its own drawing, or is there another type of control that could be used here instead?

¿Fue útil?

Solución

Investigating with the F-Script tool for Cocoa, I see that this part of Xcode's UI is implemented by an instance of an NSMatrix with the following key observations:

  • Its cells are custom classes derived from NSButtonCell, presumably for custom drawing and some eventing.
  • The mode property of the NSMatrix instance is set to NSRadioModeMatrix, to make sure that only one cell gets selected.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top