I have done some digging and I am converting an example of a Obj-C
NSOutlineView to RubyCocoa this is what I have so far:
#### start data source for outline view ######
# Must implement data source for outline view
# outlineView:numberOfChildrenOfItem:
# outlineView:isItemExpandable:
# outlineView:child:ofItem:
# outlineView:objectValueForTableColumn:byItem:
##############################################
def initialize; super;
@rootNode = Node.new
self;
end
def outlineView_numberOfChildrenOfItem(outView, item)
outView.size?
end
def outlineView_isItemExpandable(outView, item)
return item.empty?
end
def outlineView_child_ofItem(outView, child, item)
if item.nil?
@rootNode.childAtIndex(index)
else
@item.childAtIndex(index)
end
end
def outlineView_objectValueForTableColumn_byItem(outView, item)
item.keyValue('title')
end
##############################################
I am however getting an error:
RubyRaiseMan.app/Contents/Resources/MyDocument.rb:68:in `initialize':
uninitialized constant Node at MyDocument (NameError)
I am new to Ruby and to Cocoa so this is very hard and would love any
help people may have for me.
MrPotatoHead
On 05/02/2005, at 4:45 PM, mrpotatohead wrote:
> More exactly I would like examples of the correct way of creating a
> data source methods for my nsoutlineview.
>
> Thanks
>
> MrPotatoHead
>
>
> On 05/02/2005, at 4:31 PM, mrpotatohead wrote:
>
>> Hi - I am looking for a nsoutlineview example for rubycocoa.
>>
>> If anyone has this can the post it -
>>
>> Much appreciated
>>
>> MrPotatoHead
>>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Rubycocoa-talk mailing list
> Rub...@li...
> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk
|