[Monodevelop-patches-list] r568 - trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Jan 19 01:11:18 EST 2004


Author: benm
Date: 2004-01-19 01:11:18 -0500 (Mon, 19 Jan 2004)
New Revision: 568

Modified:
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeNode.cs
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeView.cs
Log:
only edit via the menu

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeNode.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeNode.cs	2004-01-19 06:00:57 UTC (rev 567)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeNode.cs	2004-01-19 06:11:18 UTC (rev 568)
@@ -166,6 +166,7 @@
 		
 		public virtual void BeginEdit ()
 		{
+			TreeView.text_render.Editable = TreeView.canEdit;
 			TreeView.SetCursor (new Gtk.TreePath (TreePath), TreeView.complete_column, true);
 			TreeView.GrabFocus ();
 		}

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeView.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeView.cs	2004-01-19 06:00:57 UTC (rev 567)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Tree/TreeView.cs	2004-01-19 06:11:18 UTC (rev 568)
@@ -7,8 +7,9 @@
 		private Gtk.TreeStore store;
 		private TreeNodeCollection nodes;
 		private bool updating = false;
-		private bool canEdit = false;
+		internal bool canEdit = false;
 		internal Gtk.TreeViewColumn complete_column;
+		internal Gtk.CellRendererText text_render;
 		
 		public TreeView () : this (false)
 		{
@@ -29,8 +30,7 @@
 			complete_column.PackStart (pix_render, false);
 			complete_column.AddAttribute (pix_render, "pixbuf", 1);
 			
-			Gtk.CellRendererText text_render = new Gtk.CellRendererText ();
-			text_render.Editable = canEdit;
+			text_render = new Gtk.CellRendererText ();
 			if (canEdit) {
 				text_render.Edited += new GtkSharp.EditedHandler (HandleOnEdit);
 			}
@@ -49,7 +49,7 @@
 
 		void HandleOnEdit (object o, GtkSharp.EditedArgs e)
 		{
-			
+			text_render.Editable = false;
 			Gtk.TreeIter iter;
 			if (! Model.GetIterFromString (out iter, e.Path))
 				throw new Exception("Error calculating iter for path " + e.Path);




More information about the Monodevelop-patches-list mailing list