public override CellEditable StartEditing(Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags)
        {
            TreeView tree = (TreeView)widget;
            TreeIter iter;

            tree.Model.GetIterFromString(out iter, path);
            ExtensionNodeDescription node = tree.Model.GetValue(iter, 2) as ExtensionNodeDescription;

            if (node != null)
            {
                editor = new ExtensionEditor(node);
                tree.Model.EmitRowChanged(new TreePath(path), iter);
                TreeViewCellContainer tc = new TreeViewCellContainer(editor);
                tc.EditingDone += delegate {
                    editor = null;
                    tree.Model.EmitRowChanged(new TreePath(path), iter);
                };
                return(tc);
            }
            else
            {
                this.StopEditing(false);
                return(null);
            }
        }
Пример #2
0
		public override CellEditable StartEditing (Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags)
		{
			TreeView tree = (TreeView) widget;
			TreeIter iter;
			tree.Model.GetIterFromString (out iter, path);
			ExtensionNodeDescription node = tree.Model.GetValue (iter, 2) as ExtensionNodeDescription;
			if (node != null) {
				editor = new ExtensionEditor (node);
				tree.Model.EmitRowChanged (new TreePath (path), iter);
				TreeViewCellContainer tc = new TreeViewCellContainer (editor);
				tc.EditingDone += delegate {
					editor = null;
					tree.Model.EmitRowChanged (new TreePath (path), iter);
				};
				return tc;
			}
			else {
				this.StopEditing (false);
				return null;
			}
		}