2005-09-06 Mike Kestner <mkestner@novell.com>
* gtk/NodeStore.cs : fix recursive emit of row_inserted. svn path=/trunk/gtk-sharp/; revision=49566
This commit is contained in:
parent
2a61d6e9d9
commit
7b265e1f84
1 changed files with 10 additions and 8 deletions
|
@ -347,10 +347,17 @@ namespace Gtk {
|
||||||
[DllImport("gtksharpglue-2")]
|
[DllImport("gtksharpglue-2")]
|
||||||
static extern void gtksharp_node_store_emit_row_inserted (IntPtr handle, IntPtr path, int node_idx);
|
static extern void gtksharp_node_store_emit_row_inserted (IntPtr handle, IntPtr path, int node_idx);
|
||||||
|
|
||||||
|
private void EmitRowInserted (ITreeNode node)
|
||||||
|
{
|
||||||
|
gtksharp_node_store_emit_row_inserted (Handle, get_path_cb (node.ID), node.ID);
|
||||||
|
for (int i = 0; i < node.ChildCount; i++)
|
||||||
|
EmitRowInserted (node [i]);
|
||||||
|
}
|
||||||
|
|
||||||
private void child_added_cb (object o, ITreeNode child)
|
private void child_added_cb (object o, ITreeNode child)
|
||||||
{
|
{
|
||||||
AddNodeInternal (child);
|
AddNodeInternal (child);
|
||||||
gtksharp_node_store_emit_row_inserted (Handle, get_path_cb (child.ID), child.ID);
|
EmitRowInserted (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("gtksharpglue-2")]
|
[DllImport("gtksharpglue-2")]
|
||||||
|
@ -398,19 +405,14 @@ namespace Gtk {
|
||||||
{
|
{
|
||||||
nodes.Add (node);
|
nodes.Add (node);
|
||||||
AddNodeInternal (node);
|
AddNodeInternal (node);
|
||||||
gtksharp_node_store_emit_row_inserted (Handle, get_path_cb (node.ID), node.ID);
|
EmitRowInserted (node);
|
||||||
for (int i = 0; i < node.ChildCount; i++)
|
|
||||||
gtksharp_node_store_emit_row_inserted (Handle, get_path_cb (node[i].ID), node[i].ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddNode (ITreeNode node, int position)
|
public void AddNode (ITreeNode node, int position)
|
||||||
{
|
{
|
||||||
nodes.Insert (position, node);
|
nodes.Insert (position, node);
|
||||||
AddNodeInternal (node);
|
AddNodeInternal (node);
|
||||||
|
EmitRowInserted (node);
|
||||||
gtksharp_node_store_emit_row_inserted (Handle, get_path_cb (node.ID), node.ID);
|
|
||||||
for (int i = 0; i < node.ChildCount; i++)
|
|
||||||
gtksharp_node_store_emit_row_inserted (Handle, get_path_cb (node[i].ID), node[i].ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveNode (ITreeNode node)
|
public void RemoveNode (ITreeNode node)
|
||||||
|
|
Loading…
Add table
Reference in a new issue