Hello!
I am using libgtk-java-2.10.2. I have a problem with a treeview column
which is suposed to be handled by a combo, but it is not selectable at
all.
This is the code:
ListStore listStore = new ListStore(new DataColumn[] {
new DataColumnString(), new DataColumnString() });
for (String key : map.keySet()) {
listStore.addRow(new DataRow().add(key).add(""));
}
ListStore comboStore = new ListStore(new DataColumn[] {
new DataColumnString(), new DataColumnString() });
comboStore.addRow(new DataRow().add("").add(""));
for (String tag : tags) {
comboStore.addRow(new DataRow().
add(tag).add(tag.substring(0,1)));
}
tree = (TreeView) glade.getWidget("treeview");
CellRendererText cell1 = new CellRendererText();
TreeViewColumn column = new TreeViewColumn();
column.setTitle("Word");
column.packStart(cell1, true);
column.addAttributeMapping(cell1, CellRendererText.Attribute.TEXT,
listStore.getDataColumn(0));
column.setSortColumn(listStore.getDataColumn(0));
tree.appendColumn(column);
CellRendererCombo cell2 = new CellRendererCombo();
column = new TreeViewColumn();
column.setTitle("Tag");
column.packStart(cell2, true);
cell2.setModel(comboStore);
cell2.setTextColumn(0);
column.addAttributeMapping(cell2, CellRendererText.Attribute.TEXT,
listStore.getDataColumn(1));
tree.appendColumn(column);
tree.setModel(listStore);
Did I miss something?
|