mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-02-02 11:01:07 +00:00
2003-11-05 Mike Kestner <mkestner@ximian.com>
* gtk/ITreeNode.cs : make Parent readonly * gtk/TreeNode.cs : use an internal method to set parent on the child, and set child.Parent to null in RemoveChild. svn path=/trunk/gtk-sharp/; revision=19651
This commit is contained in:
parent
7553348291
commit
b57221cf44
|
@ -1,3 +1,9 @@
|
||||||
|
2003-11-05 Mike Kestner <mkestner@ximian.com>
|
||||||
|
|
||||||
|
* gtk/ITreeNode.cs : make Parent readonly
|
||||||
|
* gtk/TreeNode.cs : use an internal method to set parent on the
|
||||||
|
child, and set child.Parent to null in RemoveChild.
|
||||||
|
|
||||||
2003-11-05 Moritz Balz <verteiler@mbalz.de>
|
2003-11-05 Moritz Balz <verteiler@mbalz.de>
|
||||||
|
|
||||||
* gdk/Window.custom : System.Drawing.Rectangle/Point customizations
|
* gdk/Window.custom : System.Drawing.Rectangle/Point customizations
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Gtk {
|
||||||
|
|
||||||
int ID { get; }
|
int ID { get; }
|
||||||
|
|
||||||
ITreeNode Parent { get; set; }
|
ITreeNode Parent { get; }
|
||||||
|
|
||||||
int ChildCount { get; }
|
int ChildCount { get; }
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,6 @@ namespace Gtk {
|
||||||
get {
|
get {
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
set {
|
|
||||||
parent = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ChildCount {
|
public int ChildCount {
|
||||||
|
@ -48,6 +45,11 @@ namespace Gtk {
|
||||||
return children.IndexOf (o);
|
return children.IndexOf (o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void SetParent (ITreeNode parent)
|
||||||
|
{
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
public ITreeNode this [int index] {
|
public ITreeNode this [int index] {
|
||||||
get {
|
get {
|
||||||
if (index >= ChildCount)
|
if (index >= ChildCount)
|
||||||
|
@ -87,20 +89,21 @@ namespace Gtk {
|
||||||
ChildRemoved (this, old_position);
|
ChildRemoved (this, old_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddChild (ITreeNode child)
|
public void AddChild (TreeNode child)
|
||||||
{
|
{
|
||||||
children.Add (child);
|
children.Add (child);
|
||||||
child.Parent = this;
|
child.SetParent (this);
|
||||||
OnChildAdded (child);
|
OnChildAdded (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveChild (ITreeNode child)
|
public void RemoveChild (TreeNode child)
|
||||||
{
|
{
|
||||||
int idx = children.IndexOf (child);
|
int idx = children.IndexOf (child);
|
||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
children.Remove (child);
|
children.Remove (child);
|
||||||
|
child.SetParent (null);
|
||||||
OnChildRemoved (idx);
|
OnChildRemoved (idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue