gir.core icon indicating copy to clipboard operation
gir.core copied to clipboard

Support extracting an interface instance from a GObject.Value

Open badcel opened this issue 1 year ago • 1 comments

Support extracting an interface instance from a GObject.Value.

Disfunct sample (as the event is not raised for some reason):

var application = Gtk.Application.New("org.gir.core", Gio.ApplicationFlags.FlagsNone);
application.OnActivate += (sender, args) =>
{
    var window = Gtk.ApplicationWindow.New((Gtk.Application) sender);
    window.Title = "Gtk4 Window";
    window.SetDefaultSize(300, 300);
    window.Show();
};

application.OnOpen += (sender, signalArgs) =>
{
    var files = signalArgs.Files;
};
return application.Run(1, new []{ "Test.pdf"});

badcel avatar Sep 20 '23 19:09 badcel

The first argument is expected to be program name:

https://docs.gtk.org/gio/method.Application.run.html

This function sets the prgname (g_set_prgname()), if not already set, to the basename of argv[0].

So your sample doesn't work because for Gio.Application there's nothing to open.

fsobolev avatar Sep 20 '23 20:09 fsobolev