gtk.link_button

Module for [LinkButton] class

Types 3

A GtkLinkButton is a #GtkButton 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.link_button.LinkButton.new_] or [gtk.link_button.LinkButton.newWithLabel]. 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.link_button.LinkButton.setUri], and retrieved using [gtk.link_button.LinkButton.getUri].

By default, GtkLinkButton calls [gtk.global.showUriOnWindow] when the button is clicked. This behaviour can be overridden by connecting to the #GtkLinkButton::activate-link signal and returning true from the signal handler.

CSS nodes

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

Methods
GType _gType() @property
LinkButton self()Returns `this`, for use in `with` statements.
LinkButtonGidBuilder builder()Get builder for [gtk.link_button.LinkButton] Returns: New builder object
string uri() @propertyGet `uri` property. Returns: The URI bound to this button.
void uri(string propval) @propertySet `uri` property. Params: propval = The URI bound to this button.
bool visited() @propertyGet `visited` property. Returns: The 'visited' state of this button. A visited link is drawn in a different color.
void visited(bool propval) @propertySet `visited` property. Params: propval = The 'visited' state of this button. A visited link is drawn in a different color.
gtk.link_button.LinkButton newWithLabel(string uri, string label = null)Creates a new #GtkLinkButton containing a label.
string getUri()Retrieves the URI set using [gtk.link_button.LinkButton.setUri]. Returns: a valid URI. The returned string is owned by the link button and should not be modified or freed.
bool getVisited()Retrieves the “visited” state of the URI where the #GtkLinkButton points. The button becomes visited when it is clicked. If the URI is changed on the button, the “visited” state is unset ag...
void setUri(string uri)Sets uri as the URI where the #GtkLinkButton points. As a side-effect this unsets the “visited” state of the button.
void setVisited(bool visited)Sets the “visited” state of the URI where the #GtkLinkButton points. See [gtk.link_button.LinkButton.getVisited] for more details.
gulong connectActivateLink(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.link_button.LinkButton))) && Parameters!T.length < 2)Connect to `ActivateLink` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(string uri)Creates a new #GtkLinkButton with the URI as its text.
Methods
T uri(string propval)Set `uri` property. Params: propval = The URI bound to this button. Returns: Builder instance for fluent chaining
T visited(bool propval)Set `visited` property. Params: propval = The 'visited' state of this button. A visited link is drawn in a different color. Returns: Builder instance for fluent chaining

Fluent builder for [gtk.link_button.LinkButton]

Methods