[Gtk-sharp-list] widget inheritance
Bryan Buchanan
adslh3nu at tpg.com.au
Thu Jul 28 09:48:02 EDT 2005
Hi,
Can someone please tell a dummy why the last line of code below
barfs with an error:
"Cannot cast from source type to destination type."
I obviously don't understand something fundamental !
Bryan
public class MyEntry : Gtk.Entry {
public bool flag;
public MyEntry() : base () {}
public MyEntry(System.IntPtr ptr) : base(ptr) {}
public MyEntry(string s) : base(s) {}
protected MyEntry(GLib.GType type) : base(type) {}
}
Glade.XML gxml = new Glade.XML ("myfile.glade", "window1", null);
Gtk.Entry test = (Gtk.Entry) gxml.GetWidget("entry1"); // OK
MyEntry entry = (MyEntry) gxml.GetWidget("entry1"); // barfs
More information about the Gtk-sharp-list
mailing list