I'm trying to display a list of strings (filenames, to be pedant) inside a GtkTreeView. I'm creating a single column and trying to fill it with a CellRenderText.
//Setup listview
TreeView imageList = (TreeView)gladeBuilder.getObject("imageListTreeView");
TreeViewColumn column = imageList.appendColumn();
DataColumnString imageColumnString = new DataColumnString();
//Fill listview
ListStore listStore = new ListStore(new DataColumnString[]{imageColumnString});
File[] imageFiles = new File("/path/to/files").listFiles();
// For each file:
for (File file : imageFiles) {
TreeIter row = listStore.appendRow(); //add a row
listStore.setValue(row, imageColumnString, file.getName());
}
CellRendererText cellRendererText = new CellRendererText(column);
cellRendererText.setText(imageColumnString);
The program compiles and run without errors, but the list is displayed empty. Someone can help me to find the error(s)?