Can't use Gtk.show_uri.full()
It's not possible to use Gtk.show_uri_full()
. An example code block is the following:
Gtk.Window window; // defined somewhere else
Gtk.show_uri_full.begin (window, "https://gnome.org", Gdk.CURRENT_TIME, null, (obj, res) => {
try {
Gtk.show_uri_full.end (res);
} catch (GLib.Error err) {
warning ("Can't show URI: %s", err->message);
}
});
That gives the following errors:
example.vala: In function ‘__lambda13_’:
example.vala:440:3: error: too few arguments to function ‘gtk_show_uri_full_finish’
440 | Gtk.show_uri_full.end (res);
| ^~~~~~~~~~~~~~~
In file included from /home/niels/jhbuild/install/include/gtk-4.0/gtk/gtk.h:230,
from /home/niels/jhbuild/install/include/libadwaita-1/adwaita.h:9,
from src/gnome-contacts.p/contacts-contact-sheet.c:21:
/home/niels/jhbuild/install/include/gtk-4.0/gtk/gtkshow.h:41:10: note: declared here
41 | gboolean gtk_show_uri_full_finish (GtkWindow *parent,
| ^~~~~~~~~~~~~~~~~~~~~~~~
So the problem is that gtk_show_uri_full_finish ()
needs both a GtkWindow*
and a GAsyncResult*
. Trying to circumvent it by calling Gtk.show_uri_full.end (window, res);
doesn't work either, since valac doesn't accept that.