Class: Gtk::UriLauncher

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Gtk::UriLauncher

Creates a new GtkUriLauncher object.

Parameters:

  • uri (String) —

    the uri to open

Instance Method Details

#can_launch(parent) ⇒ Boolean

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.

Parameters:

Returns:

  • (Boolean) —

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

#launch(parent, cancellable, callback, user_data) ⇒ nil

Launches an application to open the uri.

This may present an app chooser dialog to the user.

Parameters:

  • parent (Gtk::Window) —

    the parent window

  • cancellable (Gio::Cancellable) —

    a cancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback) —

    a callback to call when the
    operation is complete

  • user_data (GObject) —

    data to pass to callback

Returns:

  • (nil)

#launch_finish(result) ⇒ Boolean

Finishes the [methodGtk.UriLauncher.launch] call and
returns the result.

Parameters:

  • result (Gio::AsyncResult) —

    the result

Returns:

  • (Boolean) —

    true if an application was launched

#uri ⇒ String

The uri to launch.

Returns:

  • (String) —

    uri

#uri=(uri) ⇒ String

The uri to launch.

Parameters:

  • uri (String)

Returns:

  • (String) —

    uri

  • (String) —

    uri