Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (26 sloc) 879 Bytes
#
# GEGistListDelegate.rb
# gisteditor
#
# Created by Greg Borenstein on 6/18/09.
# Copyright (c) 2009 __MyCompanyName__. All rights reserved.
#
class GEGistListDelegate
attr_accessor :associatedDocument
def awakeFromNib()
end
def numberOfRowsInTableView(aTableView)
@library = GEGistLibrary.new
@library.gists.length
end
def tableViewSelectionDidChange(notification)
gist = GEGist.new(associatedDocument.library.gistsSortedByName[notification.object.selectedRow])
associatedDocument.setGist(gist)
end
def tableView(tableView, objectValueForTableColumn:column, row:row)
if row < associatedDocument.library.gistsSortedByName.length
return associatedDocument.library.gistsSortedByName[row].valueForKey("title") || "gist##{associatedDocument.library.gistsSortedByName[row].valueForKey('gist_id')}"
end
nil
end
end