[MacRuby-devel] Source List: NSOutlineView in a NSScrollView

Watson watson1978 at gmail.com
Fri Dec 9 23:53:09 PST 2011


Hi,

If you want to display images in NSOutlineView, I think you would use
the NSOutlineView as View-Based.
You might use the outlineView:viewForTableColumn:item instead of
outlineView:objectValueForTableColumn:byItem.

Look at my sample, you would think it isn't difficult :)
- https://github.com/Watson1978/MacRuby-Samples/tree/master/SourceListViewBased


2011/12/9 François Boone <francois.boone at usherbrooke.ca>:
> Hi,
>
> With help of Matt and Watson, I have made a tree using Outline View object and it works fine.
> Now I would like to go one step further.
>
> I would like to use the Source List object available in Object Library.  This Source List looks like Outline View with TableColumn Object. In this Table Object there is two Table Cell objects, the first one for the header and the second one, divided in two objects, for an image and a text.
>
> My question is: how to build the data to fill the Source List object: I try something like this:
> @data = [ [ {:group => 'Title'}],  [:cell => {:image => image1, :name => 'Test'} ] ] where image1 is a NSImage object.
> But this doesn't work.
>
> I don't now why it doesn't work:
> 1) a bad structure for @data
> 2) a bad binding in xib file
> 3) a bad definition of outlineView (I kept the same definition than the previous Outline View project)
>
> Thanks for reply
> François
>
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


More information about the MacRuby-devel mailing list