2
// Copyright (C) 2011 Ergo Developers
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
22
namespace Ergo.Widgets {
24
public class ErgoTaskList : Gtk.TreeView {
26
public ListStore listmodel { get; public set; }
28
public void add_task_list(int id, string list_name ,int tasks, int tasks_done){
31
listmodel.append(out iter);
32
listmodel.set(iter, 0, id, 1, list_name, 2, tasks, 3, tasks_done);
39
private ErgoWindow window;
40
public ErgoTaskList(ErgoWindow window) {
43
headers_visible = false;
44
//even_row_color = gtk.gdk.color_parse ( "#e9e9e9");
45
//odd_row_color = gtk.gdk.color_parse ( "#f3f3f3");
48
listmodel = new ListStore(4, typeof(int), // ID
49
typeof(string), // TaskList name
51
typeof(int) // Tasks done
56
insert_column_with_attributes(-1, "Task", new CellRendererText(), "text", 1);
59
var column = new Gtk.TreeViewColumn();
60
column.set_expand(true);
61
insert_column(column, -1);
65
column = new Gtk.TreeViewColumn();
66
var remove_pixbuf = new CellRendererPixbuf();
68
remove_pixbuf.clicked.connect((path) => {
69
//Delete row from backend -> refresh model
70
print("\nDelete something\n");
73
remove_pixbuf.stock_id = "gtk-close";
74
column.pack_start (remove_pixbuf, false);
75
insert_column(column, -1);