It would be ideal to be able to create a new widget that the linker uses to load its contents, for example.
public class MyDialog : Dialog
{
public MyDialog
{
Gtk.Builder builder = new Gtk.Builder ();
builder.add_from_file ("dialog.ui");
this = builder.get_object ("my_dialog") as Gtk.Widget;
}
}
Obviously, this will not work because it this =is an invalid destination, but I am wondering if there is a way to set the contents of the widget using those that were loaded from the constructor.
In the meantime, I replaced this = ...with
var content = get_content_area ();
var dialog = builder.get_object ("my_dialog") as Gtk.Widget;
var _content = (dialog as Dialog).get_content_area ();
_content.reparent (content);
which works, but it will still make sense to me to download it directly.
Thank.
source
share