Q: How do I create a "disclosure button control" in Cocoa like the one found on the save dialog?
A: Even though disclosure button controls are not immediately available on an Interface Builder palette, they can still be created easily by changing the attributes of an ordinary NSButton of type "Disclosure". Instantiate a disclosure NSButton in your window's nib, create an outlet like 'disclosureButton' in an appropriate controller class. Connect the outlet to the NSButton.
In a nib-loading method such as
Listing 1: Programatically Set the Bezel Style and Button Type
[disclosureButton setBezelStyle: NSRoundedDisclosureBezelStyle]; [disclosureButton setButtonType: NSPushOnPushOffButton];
For more information on disclosure controls, refer to "Controls > View Controls" section of the Apple Human Interface Guidelines, available at ADC Reference Library > User Experience > Fundamentals"
Document Revision History