Next: , Previous: GtkToggleButton, Up: Top


19 GtkLinkButton

Create buttons bound to a URL

19.1 Overview

A <gtk-link-button> is a <gtk-button> 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-new or gtk-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 <gtk-link-button> can be set specifically using gtk-link-button-set-uri, and retrieved using gtk-link-button-get-uri.

<gtk-link-button> offers a global hook, which is called when the used clicks on it: see gtk-link-button-set-uri-hook.

<gtk-link-button> was added in GTK+ 2.10.

19.2 Usage

— Class: <gtk-link-button>

Derives from <gtk-button>.

This class defines the following slots:

uri
The URI bound to this button
— Function: gtk-link-button-new (uri mchars) ⇒  (ret <gtk-widget>)

Creates a new <gtk-link-button> with the URI as its text.

uri
a valid URI
ret
a new link button widget.

Since 2.10

— Function: gtk-link-button-new-with-label (uri mchars) (label mchars) ⇒  (ret <gtk-widget>)

Creates a new <gtk-link-button> containing a label.

uri
a valid URI
label
the text of the button
ret
a new link button widget.

Since 2.10

— Function: gtk-link-button-get-uri (self <gtk-link-button>) ⇒  (ret mchars)
— Method: get-uri

Retrieves the URI set using gtk-link-button-set-uri.

link-button
a <gtk-link-button>
ret
a valid URI. The returned string is owned by the link button and should not be modified or freed.

Since 2.10

— Function: gtk-link-button-set-uri (self <gtk-link-button>) (uri mchars)
— Method: set-uri

Sets uri as the URI where the <gtk-link-button> points.

link-button
a <gtk-link-button>
uri
a valid URI

Since 2.10