java-gnome version 4.0.7

org.gnome.gtk
Interface TreeView.ROW_ACTIVATED

Enclosing class:
TreeView

public static interface TreeView.ROW_ACTIVATED

Emitted when a row in the TreeView has been activated. Activation occurs when a row in the view is double-clicked, or when Space or Enter is pressed while a row is selected.

In general, you've got the TreeModel and especially its DataColumns visible, so to use ROW_ACTIVATED you can just:

 final TreeModel model;
 final DataColumnString column;
 
 view.connect(new TreeView.ROW_ACTIVATED() {
     public void onRowActivated(TreeView source, TreePath path, TreeViewColumn vertical) {
         final TreeIter row;
 
         row = model.getIter(path);
 
         ... = model.getValue(row, column);
     }
 });
 
Remember that TreeIters and TreePaths are not stable over changes to the model, so get on with using path right away.

ROW_ACTIVATED is perfectly sufficient for basic situations, but you may need to see TreeSelection's CHANGED to for more complicated selection and activation expressions. In practise you'll use both.

Since:
4.0.5
Author:
Andrew Cowie

Method Summary
 void onRowActivated(TreeView source, TreePath path, TreeViewColumn vertical)
          The useful parameter is usually path which can be converted into a TreeIter with your TreeModel's getIter() allowing you to then lookup a particular value from the data model.
 

Method Detail

onRowActivated

void onRowActivated(TreeView source,
                    TreePath path,
                    TreeViewColumn vertical)
The useful parameter is usually path which can be converted into a TreeIter with your TreeModel's getIter() allowing you to then lookup a particular value from the data model. You rarely need vertical but it can give you some indication in which column the click happened.



java-gnome