Hi,
i´m working on porting a password manager written in swing to
java-gnome and, at the same time, i´m writing a glade tutorial with
those things wich i´m learning.
Now i´m working on treeview and i´ve got a little problem. When
i get the libglade widget i try to add new nodes to the tree, but
treeview doesn´t respond. I´m doing something like this:
//************** CODE *******************//
main = (Window) libglade.getWidget("main");
tree = (TreeView) libglade.getWidget("treeview");
// Make some data blocks to refer to the data for the tree
DataBlockString dataString = new DataBlockString();
DataBlockInt dataInt = new DataBlockInt();
DataBlockBoolean dataBool = new DataBlockBoolean();
DataBlockPixbuf dataPix = new DataBlockPixbuf();
[....]
// create a new column to be visible in the output, set a title for it and
// append it to the tree.
TreeViewColumn column1 = new TreeViewColumn();
column1.setTitle("Main Data");
tree.appendColumn( column1 );
tree.show();
main.showAll();
//************** CODE *******************//
That last lines should to include the new column to the tree, as shown in
java-gnome examples... but as i said, it doesn´t happens anything.
Doing something like
tree = new TreeView(store);
didn´t help.
In swing i often modified trees getting the tree model and working on it:
DefaultTreeModel model;
model = (DefaultTreeModel)controlador.cvp.win.jt.getModel();
//insercion del nuevo nodo en el jtree
model.insertNodeInto(nuevoNodo,chosen, 0);
but this doesn´t seems to work on java-gnome.
Can anyone help me or send me a treeview java-gnome example designed in
glade? Thanks a lot.
--
Alex Moreno
|