Better way to add rows
[gregoa/zavai.git] / src / calendar.vala
index 7b0ab09bf866a28f2990209520aa9f110d426643..5e258873a91bb624ef36b8efdb3372cc312526b1 100644 (file)
@@ -152,12 +152,13 @@ public class Next30 : Gtk.ScrolledWindow
                var buffer = new char[64];
                date.strftime(buffer, "%d %a");
                Gtk.TreeIter iter;
-               model.append (out iter);
-               model.set(iter, 0, (string)buffer);
-               model.set(iter, 1, notes);
-               model.set(iter, 2, date.get_year());
-               model.set(iter, 3, date.get_month());
-               model.set(iter, 4, date.get_day());
+        model.insert_with_values(out iter, -1,
+            0, (string)buffer,
+            1, notes,
+            2, date.get_year(),
+            3, date.get_month(),
+            4, date.get_day(),
+            -1);
        }
 
        public void update(Date start)