Gtk.LinkButton

const Gtk = imports.gi.Gtk;

let link_button = new Gtk.LinkButton({
    uri: value,
    visited: value,
});
  

A GtkLinkButton is a Gtk.Button with a hyperlink, similar to the one used by web browsers, which triggers an action when clicked. It is useful to show quick links to resources.

A link button is created by calling either Gtk.new or Gtk.new_with_label. If using the former, the URI you pass to the constructor is used as a label for the widget.

The URI bound to a GtkLinkButton can be set specifically using Gtk.set_uri, and retrieved using Gtk.get_uri.

By default, GtkLinkButton calls show_uri when the button is clicked. This behaviour can be overridden by connecting to the Gtk.activate-link signal and returning true from the signal handler.

Hierarchy

  • GObject.Object
    • GObject.InitiallyUnowned
      • Gtk.Widget
        • Gtk.Container
          • Gtk.Bin
            • Gtk.Button
              • Gtk.LinkButton