void OnDoubleClick() { TreeModel model; TreeIter iter; if (!tree.Selection.GetSelected(out model, out iter)) { return; } GLib.Value value = new GLib.Value(); model.GetValue(iter, 4, ref value); object item = value.Val; if (item is MethodItem) { MethodItem method = (MethodItem)item; SourceWindow sourceView = ShowSourceFor(method.ParentClass); sourceView.CenterOnMethod(method); } else { if (tree.ExpandRow(model.GetPath(iter), true)) { // LAME: This seems to collapse the entire tree... tree.CollapseRow(model.GetPath(iter)); } else { tree.ExpandRow(model.GetPath(iter), false); } } }
void OnDoubleClick() { TreeModel model; TreeIter iter; if (!tree.Selection.GetSelected(out model, out iter)) { return; } GLib.Value value = new GLib.Value(); model.GetValue(iter, 4, ref value); object item = value.Val; if (item is MethodItem) { MethodItem method = (MethodItem)item; SourceWindow sourceView = ShowSourceFor(method.ParentClass); sourceView.CenterOnMethod(method); } else { TreePath treePath = model.GetPath(iter); if (tree.GetRowExpanded(treePath)) { tree.CollapseRow(treePath); } else { tree.ExpandRow(treePath, false); } } }