It derives from <GtkButton>.
A button with a hyperlink.
It is useful to show quick links to resources.
A link button is created by calling either link-button:new or link-button: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 link-button:set-uri.
By default, <GtkLinkButton> calls
file-launcher:launch when the button
is clicked. This behaviour can be overridden by connecting to the
link-button:activate-link
signal and returning #t from the signal handler.
<GtkLinkButton> supports the following keyboard
shortcuts:
<GtkLinkButton> defines a set of built-in
actions:
clipboard.copy copies the url to the clipboard.
menu.popup opens the context menu.
<GtkLinkButton> has a single CSS node with name
button. To differentiate it from a plain
<GtkButton>, it gets the .link style class.
<GtkLinkButton> uses the
Gtk.AccessibleRole.link role.
The URI bound to this button.
Its value is a string, or #f.
Set it with (set! (link-button:uri self) value).
The ’visited’ state of this button.
A visited link is drawn in a different color.
Its value is a boolean.
Set it with (set! (link-button:visited self) value).
Retrieves the URI of the <GtkLinkButton>.
Passed: a <GtkLinkButton>.
Returned: a string.
a valid URI. The returned string is owned by the link button and should not be modified or freed.
Retrieves the “visited” state of the
<GtkLinkButton>.
The button becomes visited when it is clicked. If the URI is changed on the button, the “visited” state is unset again.
The state may also be changed using link-button:set-visited.
Passed: a <GtkLinkButton>.
Returned: a boolean.
#t if the link has been visited, #f otherwise
Creates a new <GtkLinkButton> with the URI as
its text.
Passed: a string.
a valid URI
Returned: a <GtkWidget>.
a new link button widget.
Creates a new <GtkLinkButton> containing a
label.
Passed: a string.
a valid URI
Passed, or left out: a string, or #f.
the text of the button
Returned: a <GtkWidget>.
a new link button widget.
Sets uri as the URI where the
<GtkLinkButton> points.
As a side-effect this unsets the “visited” state of the button.
Passed: a <GtkLinkButton>.
Passed: a string.
a valid URI
Sets the “visited” state of the
<GtkLinkButton>.
See link-button:get-visited? for
more details.
Passed: a <GtkLinkButton>.
Passed: a boolean.
the new “visited” state
Connect a handler with (connect object link-button:activate-link
handler). It is called as (handler self) ⇒ %return.
Emitted each time the <GtkLinkButton> is
clicked.
The default handler will call file-launcher:launch with the URI stored inside the
link-button:uri property.
To override the default behavior, you can connect to the ::activate-link
signal and stop the propagation of the signal by returning #t
from your handler.
Passed: a <GtkLinkButton>.
Returned: a boolean.
#t if the signal has been handled