diff --git a/ChangeLog b/ChangeLog index 1404b3609..d7056948f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-02-15 Dan Winship + + * generator/ObjectGen.cs (GenChildProperties): If the class has an + ancestor that also defines child properties, make its child + properties class be a subclass of that ancestor's child properties + class. (Eg, make Gtk.ButtonBox.ButtonBoxChild be a subclass of + Gtk.Box.BoxChild.) + 2005-02-14 Mike Kestner * gdk/Gdk.metadata : mark the color in Rgb.FindColor ref. diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index da66d63e7..e13de8e58 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -257,7 +257,12 @@ namespace GtkSharp.Generation { StreamWriter sw = gen_info.Writer; - sw.WriteLine ("\t\tpublic class " + Name + "Child : Gtk.Container.ContainerChild {"); + ObjectGen child_ancestor = Parent as ObjectGen; + while (child_ancestor.CName != "GtkContainer" && + child_ancestor.childprops.Count == 0) + child_ancestor = child_ancestor.Parent as ObjectGen; + + sw.WriteLine ("\t\tpublic class " + Name + "Child : " + child_ancestor.NS + "." + child_ancestor.Name + "." + child_ancestor.Name + "Child {"); sw.WriteLine ("\t\t\tprotected internal " + Name + "Child (Gtk.Container parent, Gtk.Widget child) : base (parent, child) {}"); sw.WriteLine ("");