How can I implement a thumbnail-based view for user selection in Cocoa? -


The idea that I thought was very easy, but I'm not sure how to implement it. .

At different points of my interface, the user is asked to create a scene of something (like selecting a layout for the page or color option.) These selections are made from a set of pre-defined options Normally you will use NSPopUpButton, or maybe a NSTableView, but I want to see the thumbnail of the user's choice option. These thumbnails should be a decent size, at least 100x100 pixels. Each thumbnail should also be accompanied by a text label.

Of course, you are using something like this to see IWeb:

with small symbols:

< P>

I think there is space to start an NSCollectionView, but I have ever used it in very complex scenarios (like: displaying the contents of a directory, drag and drop support etc.) ) Therefore, I've found that most code is complicated.

Is there a simple solution to populate this view with static, pre-defined data and allow for a simple selection? In other words, I see the functionality of a pop-up button but there is a different user interface.

Update: Solution

I have been suggested as IKImageBrowser. Was very helpful in IB: I just created an IKImage browser in one interface, wrapped it in a scroll view, and it created the data source of the browser object. In code: Like the tutorial, implementing the data source protocol in my controller, the set allows the empty selection for multiplexation and permission, a custom image object has been created using URL image rendering as explained in the tutorial .

Then, select the selection, I wrote the following method when the user clicks on the "OK" button:

  NSIndexSet * retval = [imageBrowser selection index]; NSInteger i = [Retold first index]; // Index of selection is consistent with the index in my array data source NSString * path = [[style view data objectinclude index: i] image report); // The path to the selected image, if you need it, the tutorial is very useful - just add images and ignore the zoom slider and such things. 

You want the IKImageBrowserView.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -