Package org.gnome.gtk

Class LinkButton

java.lang.Object
All Implemented Interfaces:
Proxy, Accessible, Actionable, Buildable, ConstraintTarget

@Generated("io.github.jwharm.JavaGI") public class LinkButton extends Button implements Accessible, Actionable, Buildable, ConstraintTarget
A GtkLinkButton is a button with a hyperlink.

An example GtkLinkButton

It is useful to show quick links to resources.

A link button is created by calling either LinkButton(java.lang.String) or withLabel(java.lang.String, java.lang.String). 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 setUri(java.lang.String).

By default, GtkLinkButton calls FileLauncher.launch(org.gnome.gtk.Window, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback) when the button is clicked. This behaviour can be overridden by connecting to the Gtk.LinkButton::activate-link signal and returning true from the signal handler.

Shortcuts and Gestures
GtkLinkButton supports the following keyboard shortcuts:

  • Shift+F10 or Menu opens the context menu.

Actions
GtkLinkButton defines a set of built-in actions:

  • clipboard.copy copies the url to the clipboard.
  • menu.popup opens the context menu.

CSS nodes
GtkLinkButton has a single CSS node with name button. To differentiate it from a plain GtkButton, it gets the .link style class.

Accessibility
GtkLinkButton uses the AccessibleRole.LINK role.