Package: gtk

Class gtk:uri-launcher

Superclasses

gobject:object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

uri
The uri property of type :string (Read / Write)
The URI to launch.

Details

The gtk:uri-launcher 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 gtk:uri-launcher-launch function. This API follows the GIO async pattern, and the result can be obtained by calling the gtk:uri-launcher-launch-finish function.

To launch a file, use the gtk:file-launcher object.

Since 4.10

Examples

The following example shows a signal handler for a button. The signal handler retrieves the URI from the label of the button and launches it.
(g:signal-connect picker "clicked"
    (lambda (button)
      (let* ((parent (gtk:widget-root button))
             (uri (gtk:button-label button))
             (launcher (gtk:uri-launcher-new uri)))
        (gtk:uri-launcher-launch launcher parent nil
            (lambda (source result)
              (let ((success (gtk:uri-launcher-launch-finish source result)))
                (if success
                    (format t "URI ~a successfully launched.~%" uri)
                    (format t "URI ~a not launched.~%" uri))))))))    
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2026-01-03