From d33153086ed9661bfbf852cf154f70c5bdb7b20f Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 15 Mar 2005 15:49:30 +0000 Subject: [PATCH] Re-fix for yesterday's fix that didn't actually work. * gtk/ITreeNode.cs: add a "child" arg to TreeNodeRemovedHandler * gtk/TreeNode.cs (RemoveChild, OnChildRemoved): update for that * gtk/NodeStore.cs (child_deleted_cb): use the passed-in child; GetNodeAtPath won't work because the parent node already removed the child from its list svn path=/trunk/gtk-sharp/; revision=41837 --- ChangeLog | 12 ++++++++++++ gtk/ITreeNode.cs | 2 +- gtk/NodeStore.cs | 3 +-- gtk/TreeNode.cs | 6 +++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 720a7562e..d2443769b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-03-15 Dan Winship + + Re-fix for yesterday's fix that didn't actually work. + + * gtk/ITreeNode.cs: add a "child" arg to TreeNodeRemovedHandler + + * gtk/TreeNode.cs (RemoveChild, OnChildRemoved): update for that + + * gtk/NodeStore.cs (child_deleted_cb): use the passed-in child; + GetNodeAtPath won't work because the parent node already removed + the child from its list + 2005-03-14 Mike Kestner * configure.in : rework the gtkhtml check for 3.6. diff --git a/gtk/ITreeNode.cs b/gtk/ITreeNode.cs index feed4b319..5fae91969 100644 --- a/gtk/ITreeNode.cs +++ b/gtk/ITreeNode.cs @@ -25,7 +25,7 @@ namespace Gtk { public delegate void TreeNodeAddedHandler (object o, ITreeNode child); - public delegate void TreeNodeRemovedHandler (object o, int old_position); + public delegate void TreeNodeRemovedHandler (object o, ITreeNode child, int old_position); public interface ITreeNode { diff --git a/gtk/NodeStore.cs b/gtk/NodeStore.cs index fcd3385e2..b1e0a6712 100644 --- a/gtk/NodeStore.cs +++ b/gtk/NodeStore.cs @@ -342,7 +342,7 @@ namespace Gtk { RemoveNodeInternal (node [i]); } - private void child_deleted_cb (object o, int idx) + private void child_deleted_cb (object o, ITreeNode child, int idx) { ITreeNode node = o as ITreeNode; @@ -350,7 +350,6 @@ namespace Gtk { TreePath child_path = path.Copy (); child_path.AppendIndex (idx); - ITreeNode child = GetNodeAtPath (child_path); RemoveNodeInternal (child); gtksharp_node_store_emit_row_deleted (Handle, child_path.Handle); diff --git a/gtk/TreeNode.cs b/gtk/TreeNode.cs index c48dd2af5..f3a28bde0 100644 --- a/gtk/TreeNode.cs +++ b/gtk/TreeNode.cs @@ -96,12 +96,12 @@ namespace Gtk { public event TreeNodeRemovedHandler ChildRemoved; - private void OnChildRemoved (int old_position) + private void OnChildRemoved (TreeNode child, int old_position) { if (ChildRemoved == null) return; - ChildRemoved (this, old_position); + ChildRemoved (this, child, old_position); } public void AddChild (TreeNode child) @@ -126,7 +126,7 @@ namespace Gtk { children.Remove (child); child.SetParent (null); - OnChildRemoved (idx); + OnChildRemoved (child, idx); } } }