1.211 <GtkUriLauncher>

Class: <GtkUriLauncher>

It derives from <GObject>.

Asynchronous API to open a uri with an application.

<GtkUriLauncher> collects the arguments that are needed to open the uri.

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 uri-launcher:launch function.

To launch a file, use <GtkFileLauncher>.

Properties

Property: uri-launcher:uri self

The uri to launch.

Its value is a string, or #f.

Set it with (set! (uri-launcher:uri self) value).

Procedures

Method: uri-launcher:can-launch? self [parent] ⇒ %return
Method: can-launch? self [parent] ⇒ %return

Returns whether the launcher is likely to succeed in launching an application for its uri.

This can be used to disable controls that trigger the launcher when they are known not to work.

self

Passed: a <GtkUriLauncher>.

an uri launcher

parent

Passed, or left out: a <GtkWindow>, or #f.

the parent window

%return

Returned: a boolean.

false if the launcher is known not to support the uri, true otherwise

Method: uri-launcher:get-uri self ⇒ %return
Method: get-uri self ⇒ %return

Gets the uri that will be opened.

self

Passed: a <GtkUriLauncher>.

an uri launcher

%return

Returned: a string, or #f.

the uri

Method: uri-launcher:launch self [parent] [cancellable] [callback]
Method: launch self [parent] [cancellable] [callback]

Launches an application to open the uri.

This may present an app chooser dialog to the user.

self

Passed: a <GtkUriLauncher>.

an uri launcher

parent

Passed, or left out: a <GtkWindow>, or #f.

the parent window

cancellable

Passed, or left out: a <GCancellable>, or #f.

a cancellable to cancel the operation

callback

Passed, or left out: a procedure, or #f.

a callback to call when the operation is complete

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Method: uri-launcher:launch-finish? self result ⇒ %return
Method: launch-finish? self result ⇒ %return

Finishes the uri-launcher:launch call and returns the result.

self

Passed: a <GtkUriLauncher>.

an uri launcher

result

Passed: a <GAsyncResult>.

the result

%return

Returned: a boolean.

true if an application was launched

Procedure: uri-launcher:new [uri] ⇒ %return

Creates a new <GtkUriLauncher> object.

uri

Passed, or left out: a string, or #f.

the uri to open

%return

Returned: a <GtkUriLauncher>.

the new <GtkUriLauncher>

Method: uri-launcher:set-uri self [uri]
Method: set-uri self [uri]

Sets the uri that will be opened.

self

Passed: a <GtkUriLauncher>.

an uri launcher

uri

Passed, or left out: a string, or #f.

the uri