Gtk.UriLauncher

g GObject.Object GObject.Object Gtk.UriLauncher Gtk.UriLauncher GObject.Object->Gtk.UriLauncher

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (uri)

get_uri ()

launch (parent, cancellable, callback, *user_data)

launch_finish (result)

set_uri (uri)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

uri

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.UriLauncher(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gtk.UriLauncherClass

A GtkUriLauncher object collects the arguments that are needed to open a uri with an application.

Depending on system configuration, user preferences and available APIs, this may or may not show an app chooser dialog or launch the default application right away.

The operation is started with the [method`Gtk`.UriLauncher.launch] function. This API follows the GIO async pattern, and the result can be obtained by calling [method`Gtk`.UriLauncher.launch_finish].

To launch a file, use [class`Gtk`.FileLauncher].

New in version 4.10.

classmethod new(uri)[source]
Parameters:

uri (str or None) – the uri to open

Returns:

the new GtkUriLauncher

Return type:

Gtk.UriLauncher

Creates a new GtkUriLauncher object.

New in version 4.10.

get_uri()[source]
Returns:

the uri

Return type:

str or None

Gets the uri that will be opened.

New in version 4.10.

launch(parent, cancellable, callback, *user_data)[source]
Parameters:

Launch an application to open the uri.

This may present an app chooser dialog to the user.

The callback will be called when the operation is completed. It should call [method`Gtk`.UriLauncher.launch_finish] to obtain the result.

New in version 4.10.

launch_finish(result)[source]
Parameters:

result (Gio.AsyncResult) – a GAsyncResult

Raises:

GLib.Error

Returns:

TRUE if an application was launched, or FALSE and error is set

Return type:

bool

Finishes the [method`Gtk`.UriLauncher.launch] call and returns the result.

New in version 4.10.

set_uri(uri)[source]
Parameters:

uri (str or None) – the uri

Sets the uri that will be opened.

New in version 4.10.

Property Details

Gtk.UriLauncher.props.uri
Name:

uri

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The uri to launch.

New in version 4.10.