LinkButton

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 [ctor@Gtk.LinkButton.new] or [ctor@Gtk.LinkButton.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 [method@Gtk.LinkButton.set_uri].

By default, GtkLinkButton calls [func@Gtk.show_uri] when the button is clicked. This behaviour can be overridden by connecting to the [signal@Gtk.LinkButton::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.

Accessibility

GtkLinkButton uses the #GTK_ACCESSIBLE_ROLE_LINK role.

Constructors

this
this(GtkLinkButton* gtkLinkButton, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string uri)

Creates a new GtkLinkButton with the URI as its text.

this
this(string uri, string label)

Creates a new GtkLinkButton containing a label.

Members

Functions

addOnActivateLink
gulong addOnActivateLink(bool delegate(LinkButton) dlg, ConnectFlags connectFlags)

Emitted each time the GtkLinkButton is clicked.

getLinkButtonStruct
GtkLinkButton* getLinkButtonStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getUri
string getUri()

Retrieves the URI of the GtkLinkButton.

getVisited
bool getVisited()

Retrieves the “visited” state of the GtkLinkButton.

setUri
void setUri(string uri)

Sets @uri as the URI where the GtkLinkButton points.

setVisited
void setVisited(bool visited)

Sets the “visited” state of the GtkLinkButton.

Static functions

getType
GType getType()

Variables

gtkLinkButton
GtkLinkButton* gtkLinkButton;

the main Gtk struct

Inherited Members

From Button

gtkButton
GtkButton* gtkButton;

the main Gtk struct

getButtonStruct
GtkButton* getButtonStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

__anonymous
mixin ActionableT!(GtkButton)
Undocumented in source.
getType
GType getType()
getChild
Widget getChild()

Gets the child widget of @button.

getHasFrame
bool getHasFrame()

Returns whether the button has a frame.

getIconName
string getIconName()

Returns the icon name of the button.

getLabel
string getLabel()

Fetches the text from the label of the button.

getUseUnderline
bool getUseUnderline()

gets whether underlines are interpreted as mnemonics.

setChild
void setChild(Widget child)

Sets the child widget of @button.

setHasFrame
void setHasFrame(bool hasFrame)

Sets the style of the button.

setIconName
void setIconName(string iconName)

Adds a GtkImage with the given icon name as a child.

setLabel
void setLabel(string label)

Sets the text of the label of the button to @label.

setUseUnderline
void setUseUnderline(bool useUnderline)

Sets whether to use underlines as mnemonics.

addOnActivate
gulong addOnActivate(void delegate(Button) dlg, ConnectFlags connectFlags)

Emitted to animate press then release.

addOnClicked
gulong addOnClicked(void delegate(Button) dlg, ConnectFlags connectFlags)

Emitted when the button has been activated (pressed and released).

Meta