diff --git a/gtk.yml b/gtk.yml index b97cf5934..7c2b5f9a6 100644 --- a/gtk.yml +++ b/gtk.yml @@ -1,6 +1,7 @@ include: - src/includes/about_dialog.cr - src/includes/builder.cr + - src/includes/list_store.cr - src/includes/message_dialog.cr - src/includes/tree_view.cr diff --git a/src/includes/list_store.cr b/src/includes/list_store.cr new file mode 100644 index 000000000..f546a78ed --- /dev/null +++ b/src/includes/list_store.cr @@ -0,0 +1,16 @@ +module Gtk + class ListStore + def append(columns : Enumerable(Int32), values : Enumerable) : TreeIter + iter = append + set(iter, columns, values) + iter + end + + def set(row : Int32, columns : Enumerable(Int32), values : Enumerable) : TreeIter + tree_path = Gtk::TreePath.new_from_indices({row}) + iter = iter(tree_path) + set(iter, columns, values) + iter + end + end +end