LinkButton

A gtk.link_button.LinkButton 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 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 gtk.link_button.LinkButton can be set specifically using gtk.link_button.LinkButton.setUri.

By default, gtk.link_button.LinkButton calls gtk.file_launcher.FileLauncher.launch 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

gtk.link_button.LinkButton has a single CSS node with name button. To differentiate it from a plain gtk.button.Button, it gets the .link style class.

Accessibility

gtk.link_button.LinkButton uses the gtk.types.AccessibleRole.Link role.

Constructors

this
this(string uri)

Creates a new gtk.link_button.LinkButton with the URI as its text.

Members

Functions

connectActivateLink
ulong connectActivateLink(T callback, Flag!"After" after)

Connect to ActivateLink signal.

getUri
string getUri()

Retrieves the URI of the gtk.link_button.LinkButton.

getVisited
bool getVisited()

Retrieves the “visited” state of the gtk.link_button.LinkButton.

setUri
void setUri(string uri)

Sets uri as the URI where the gtk.link_button.LinkButton points.

setVisited
void setVisited(bool visited)

Sets the “visited” state of the gtk.link_button.LinkButton.

Static functions

newWithLabel
gtk.link_button.LinkButton newWithLabel(string uri, string label)

Creates a new gtk.link_button.LinkButton containing a label.

Inherited Members

From Button

newFromIconName
gtk.button.Button newFromIconName(string iconName)

Creates a new button containing an icon from the current icon theme.

newWithLabel
gtk.button.Button newWithLabel(string label)

Creates a gtk.button.Button widget with a gtk.label.Label child.

newWithMnemonic
gtk.button.Button newWithMnemonic(string label)

Creates a new gtk.button.Button containing a label.

getCanShrink
bool getCanShrink()

Retrieves whether the button can be smaller than the natural size of its contents.

getChild
gtk.widget.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.

setCanShrink
void setCanShrink(bool canShrink)

Sets whether the button size can be smaller than the natural size of its contents.

setChild
void setChild(gtk.widget.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 gtk.image.Image 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.

connectActivate
ulong connectActivate(T callback, Flag!"After" after)

Connect to Activate signal.

connectClicked
ulong connectClicked(T callback, Flag!"After" after)

Connect to Clicked signal.