Function

Gtkshow_uri_on_window

since: 3.22

Declaration [src]

gboolean
gtk_show_uri_on_window (
  GtkWindow* parent,
  const char* uri,
  guint32 timestamp,
  GError** error
)

Description [src]

This is a convenience function for launching the default application to show the uri. The uri must be of a form understood by GIO (i.e. you need to install gvfs to get support for uri schemes such as http:// or ftp://, as only local files are handled by GIO itself). Typical examples are - file:///home/gnome/pict.jpg - http://www.gnome.org - mailto:me@gnome.org

Ideally the timestamp is taken from the event triggering the gtk_show_uri() call. If timestamp is not known you can take GDK_CURRENT_TIME.

This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.

Available since: 3.22

Parameters

parent

Type: GtkWindow

Parent window.

The argument can be NULL.
The data is owned by the caller of the function.
uri

Type: const char*

The uri to show.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
timestamp

Type: guint32

A timestamp to prevent focus stealing.

error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE on success, FALSE on error.