Class: Todoable::UI::ListsTreeView

Inherits:
Gtk::TreeView
  • Object
show all
Defined in:
lib/todoable/ui/gtk/lists.rb

Constant Summary

COLUMN_LIST =
0
COLUMN_ID =
1
COLUMN_NAME =
2
COLUMN_EDIT =
3
COLUMN_DELETE =
4

Instance Method Summary collapse

Constructor Details

#initialize(listsbox, mainpanel) ⇒ ListsTreeView

Returns a new instance of ListsTreeView



102
103
104
105
106
107
108
# File 'lib/todoable/ui/gtk/lists.rb', line 102

def initialize listsbox, mainpanel
  @model = Gtk::ListStore.new Object, String, String, String, String
  super @model
  @listsbox = listsbox
  @mainpanel = mainpanel
  setup_columns
end

Instance Method Details

#append(list) ⇒ Object



110
111
112
113
114
115
116
117
118
# File 'lib/todoable/ui/gtk/lists.rb', line 110

def append list
  @model.append.set_values [
list,
list.id,
"<big>#{list.name}</big>",
"document-edit-symbolic",
"edit-delete-symbolic"
]
end

#clearObject



120
121
122
# File 'lib/todoable/ui/gtk/lists.rb', line 120

def clear
  @model.clear
end