On 25-10-18 20:17, aedt wrote:
Hello
When I run this program, instead of showing me a list of 3 rows, the treeview is showing me only 1 row. I'm guessing the iter is not pointing to the new row in buildModel()? If not, what's causing this?
You will need to call append
to add a new row, append will also update
the iter.
ListStore buildModel() {
import gtk.ListStore : ListStore;
import gtkc.gobjecttypes : GType;
auto ls = new ListStore([GType.STRING, GType.STRING]);
import gtk.TreeIter : TreeIter;
auto ti = ls.createIter();
ls.setValue(ti, Columns.TEXT, "Arch");
ls.setValue(ti, Columns.EDITABLE_TEXT, "https://www.archlinux.org/");
ls.append(ti);
ls.setValue(ti, Columns.TEXT, "Debian");
ls.setValue(ti, Columns.EDITABLE_TEXT, "https://www.debian.org/");
ls.append(ti);
ls.setValue(ti, Columns.TEXT, "Fedora");
ls.setValue(ti, Columns.EDITABLE_TEXT, "https://getfedora.org/");
return ls;
}