Cocoa Manage / View to display directory listing
I'm new to Cocoa development - I want to display an arbitrary number of directory paths in a control / view. What's the best type of inline control / view to do this?
Requirements:
It should only be a flat list, not a complete filesystem browser. Users should be able to select one (or more) items and remove them (I provided a delete button) Users should be able to add items to this list (I provided a button that launches OpenPanel that allows them to choose a path)Any suggestions?
Also, where can I find one of these "| + | - |" types to add / remove items that are common across many Mac user interfaces?
Thanks!
You may be looking for the NSTableView class if you just want to display directory paths as a list. The NSOutlineView class is a subclass of NSTableView that allows you to group items in a hierarchical list. Multiple rows can be selected for both classes, so multiple items can be deleted.
In response to your second question, common +/- square controls are implemented in Interface Builder with a square (equal width and height) NSButton
with style Gradient
. The + and icons are just images set using an attribute Image
in the inspector - NSAddTemplate
for either the + NSRemoveTemplate
button or the - button.
a source to share