Consider the following:
class MyCustomWidget : Gtk.Widget {
public MyCustomWidget () {
Object ();
}
}
void main (string args[]) {
string ui_string = """
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="MyCustomWidget">
</object>
</interface>
""";
Gtk.init (ref args);
Gtk.Builder builder = new Gtk.Builder.from_string (ui_string, ui_string.length);
}
I am creating a custom Widget derived from Gtk.Widget. When using this widget with Gtk.Builder, I get the following error and the program crashes:
(bla:22282): Gtk-ERROR **: failed to add UI: .:4:1 Invalid object type 'MyCustomWidget'