OSX List Component Objective-C - xcode

I am a beginner at Objective-C I have been looking all over Google and Xcode to find an OSX list component. I have not found any yet, and I would like to find a list like the one in the red box below:
I just want to find a list component. Whenever I Google search, all that comes up is stuff about how to make a list programmatically in Objective-C, making mutable lists in Objective-C, etc... Would love to find a list component. Thanks!

Checking the specific view you have highlighted with F-Script Anywhere indicates that it's an NSOutlineView. That said, I haven't seen it do anything that actually requires the outline parts of NSOutlineView (collapsing multiple rows into a single one), so I'm guessing that for your purposes, its superclass NSTableView will suffice.

Related

Custom NSDatePicker graphical calender-like pickers

For example, I wanted to have a popover or something that would let me choose from a table (say, like the periodic table, IPA chart, etc.…) in a similar style as a graphical NSDatePicker. In addition, how could I make it select multiple cells at once?
Is there already a default Cocoa way to do so? If not, from what class could such a thing be done and maybe some pointers on from where to proceed?
(I apologize if this is another common question, but I couldn't find it on my own.)
It is very surprising, but on a lot of points, I think that OSX's GUI is very limited unlike iOS.
So, I'm afraid that you have to create your own component from scratch.
Or you can have a look at these open-source controls written for OSX :
For choosing a date : You can use MLCalendarView (Calendar-OSX) available on Github.
For displaying a TableView, with multiple selections (very similar to UITableView) : you can use this great open-source component : PXListView available on Github.

NSCollectionView with sections - like in iPhoto

I'd like to build a NSCollectionView similar to the one in iPhoto '11. I want to group several pictures in section, and create a section header as well. The section header of a specific section is always visible until the last element of that section is visible. You can take a look at the picture to see what I mean.
EDIT: I should add that the contents are not images.
Thanks in advance
You're probably going to have to look at using CALayers directly. NSCollectionView gets most of its magic from CoreAnimation IIRC, and it looks like you might have to duplicate some of that. Alternatively you could try using nested collection views— one containing groups, then each group contains another collection view of individual items.
Either way, your view/layer hierarchy is going to be the same. You'll have a top-level container which has only one column (since groups stretch across the entire width), then each item within that will have any number of columns, based on the item width. i.e. your 'group' collection view items will stretch to fill width, but your individual items within those groups won't.
If you choose to use the raw CALayer approach, then you'll want to look at CAConstraintLayoutManager. This is what provides the magic inside NSCollectionView. A good place to start looking for information on this is Bill Dudney's CoreAnimation book from Pragmatic Programmers. Bill's now the official platform evangelist for Apple, so I think it's safe to say he knows what he's talking about in there.
Overall, I'd suggest using a nested NSCollectionView approach to start with, and look at dropping down to raw CoreAnimation only if performance seems to be lacking, or if you have issues getting some stuff to work. Using NSCollectionView lets you keep all your current NSView-ness in place, so it will be less work. If it turns out ok, then you're home & dry. If not, you've got something else to try which you can tweak to your heart's content.
Here is a similar sample:
Check this: https://developer.apple.com/library/mac/samplecode/TableViewPlayground/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010727

NSOutlineView as Source list with core data

Im working on an app that needs a source list like the the ones found in Finder. So far I've gotten Core Data working with an NSOutlineView but the group headings don't look very source list like. A real source list group heading looks like and the standered on in an NSOutlineView looks like . It appears that the only major differences are text color and capital letters. Is it possible to change the color of only the group headings or is there a source list heading "theme" I can use?
In Interface Builder make sure to set the TableView's Highlight value to Source List (the default is regular). Then make sure you implement the -outlineView:isGroupItem: delegate method and return YES for any group item.
Check out the SourceView sample code in Apple's developer documentation. They provide a really good example of how to do this. It requires a bit of code in the NSOutlineView delegate, and there is no default "theme" or anything, but this should put you on the right track.

Is there a simple way to combine a text and icon in an NSCell in Cocoa?

I'm trying to create a very simple selection list widget based on NSOutlineView. However, I'm having a hard time figuring out how to display an icon and a label right next to it, which is really the expected behavior in all the mainstream implementations of that kind of widget out there (iTunes, mail, Finder,...).
So far I am just binding two separate cells, but then when I'm expanding the tree, the icon cell grows larger and a gap appears between the icon and its accompanying label. I know I can probably overcome this problem by extending NSCell and provide a custom class, but as what I'm trying to achieve is really the standard thing, I can't be resigned to accept that there isn't a simpler solution.
Candide
Sadly, there isn't a 'text and icon' cell that you can just use, fresh out of the box as you would like. However, when I was working on a project, I found that Apple released some sample code that implements this, since it is such a common idiom.
This can be found here, specifically ImageAndTextCell.h/m
It can help teach you about UI customization by reading through this example, but scratching that, just dropping the ImageAndTextCell straight into your project should do just fine.
You need to create ImageAndTextcell to combine text and icon..
you can create ImageAndTextcell like this Sample Project

What is the name of this Mac OS X control?

Does this control have a name? Or is it just a bunch of simple controls merged together? If so, what controls are they?
http://img8.imageshack.us/img8/3002/picture2xrb.png
It looks like an NSTableView with an a custom cell type and no column header. Have a look at the documentation for NSTableView's tableView:dataCellForTableColumn:row:. For columns which have the same type for all rows you may also set the cell class in interface builder.
I doubt the search box is part of the same control.
You could open the Application's Nib file to see what is in there. Look inside the application bundle. If the application is called Example then you should be able to find the Nib at Example.app/Contents/Resources/English.lproj/MainMenu.nib.
The best tool for investigating this is fscript, specifically FScriptAnywhere which will let you determine the class and much other information about any visual element of any Cocoa program (and do a lot of other interesting things with Cocoa programs).
In addition to what toholio said, an easy way to get the look and feel of the bottom button bar is with BWToolkit.

Resources