Gtk.UriLauncher¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.UriLauncher(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
- Returns:
the new
GtkUriLauncher
- Return type:
Creates a new
GtkUriLauncher
object.New in version 4.10.
- launch(parent, cancellable, callback, *user_data)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – the parentGtkWindow
cancellable (
Gio.Cancellable
orNone
) – aGCancellable
to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
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
) – aGAsyncResult
- Raises:
- Returns:
TRUE
if an application was launched, orFALSE
and error is set- Return type:
Finishes the [method`Gtk`.UriLauncher.launch] call and returns the result.
New in version 4.10.