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
This commit is contained in:
Dan Winship 2005-03-15 15:49:30 +00:00
parent 54d88f4e35
commit d33153086e
4 changed files with 17 additions and 6 deletions

View file

@ -1,3 +1,15 @@
2005-03-15 Dan Winship <danw@novell.com>
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 <mkestner@novell.com>
* configure.in : rework the gtkhtml check for 3.6.

View file

@ -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 {

View file

@ -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);

View file

@ -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);
}
}
}