-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathGEGistListDelegate.rb
More file actions
31 lines (26 loc) · 879 Bytes
/
GEGistListDelegate.rb
File metadata and controls
31 lines (26 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
# 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