Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X UI: How to create plus & minus buttons?

In my current application, I would like to add plus & minus buttons like the ones you see all over the place on Mac OS X, e.g.

Mac OS X UI plus minus buttons sample screenshot

I know in general how to add buttons to a user interface, but these plus & minus buttons are so ubiquitous that I imagine Apple have coined a special term for them (like 'drawer' or 'sheet') and prepared a really simple way to add them.

Unfortunately, 'plus' and 'minus' seem to be too generic terms to yield useful Google results and I don't know what else to search for :-(

Any pointers would be greatly appreciated.

like image 396
ssc Avatar asked Jan 22 '15 12:01

ssc


1 Answers

Honestly, in all the apps I've ever written, they're just two square buttons aligned carefully side-by-side.

The only trick is to use NSAddTemplate and NSRemoveTemplate when providing your buttons their images - these are system-provided images that will look like the ones in your screenshot.

like image 108
Craig Otis Avatar answered Oct 14 '22 13:10

Craig Otis