## GtkLinkButton GtkLinkButton |

## Functions

GtkWidget * | gtk_link_button_new ()
GtkWidget * | gtk_link_button_new_with_label ()
const gchar * | gtk_link_button_get_uri ()
void | gtk_link_button_set_uri ()
void | (*GtkLinkButtonUriFunc) ()
GtkLinkButtonUriFunc | gtk_link_button_set_uri_hook ()
gboolean | gtk_link_button_get_visited ()
void | gtk_link_button_set_visited ()

## Properties

gchar * | uri | Read / Write
gboolean | visited | Read / Write

## Types and Values

struct | GtkLinkButton

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkObject
                ╰── GtkWidget
                    ╰── GtkContainer
                        ╰── GtkBin
                            ╰── GtkButton
                                ╰── GtkLinkButton

## Implemented Interfaces

GtkLinkButton implements AtkImplementorIface, GtkBuildable and GtkActivatable.

## Includes

    #include <gtk/gtk.h>

## Description

## Functions

### gtk_link_button_new ()

    GtkWidget *
    gtk_link_button_new (const gchar *uri);

Creates a new GtkLinkButton with the URI as its text.

#### Parameters

uri | a valid URI |

#### Returns

a new link button widget.

Since: 2.10

### gtk_link_button_new_with_label ()

    GtkWidget *
    gtk_link_button_new_with_label (const gchar *uri,
                                    const gchar *label);

Creates a new GtkLinkButton containing a label.

#### Parameters

uri | a valid URI |
label | the text of the button. | [allow-none]

#### Returns

a new link button widget.

[transfer none]

Since: 2.10

### gtk_link_button_get_uri ()

    const gchar *
    gtk_link_button_get_uri (GtkLinkButton *link_button);

Retrieves the URI set using `gtk_link_button_set_uri()`.

#### Parameters

link_button | a GtkLinkButton |

#### Returns

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

Since: 2.10

### gtk_link_button_set_uri ()

    void
    gtk_link_button_set_uri (GtkLinkButton *link_button,
                             const gchar *uri);

Sets `uri` as the URI where the GtkLinkButton points. As a side-effect this unsets the 'visited' state of the button.

#### Parameters

link_button | a GtkLinkButton |
uri | a valid URI |

Since: 2.10

### GtkLinkButtonUriFunc ()

    void
    (*GtkLinkButtonUriFunc) (GtkLinkButton *button,
                             const gchar *link_,
                             gpointer user_data);

### gtk_link_button_set_uri_hook ()

    GtkLinkButtonUriFunc
    gtk_link_button_set_uri_hook (GtkLinkButtonUriFunc func,
                                  gpointer data,
                                  GDestroyNotify destroy);

`gtk_link_button_set_uri_hook` has been deprecated since version 2.24 and should not be used in newly-written code.

Use the “clicked” signal instead

Sets `func` as the function that should be invoked every time a user clicks a GtkLinkButton. This function is called before every callback registered for the "clicked" signal.

If no uri hook has been set, GTK+ defaults to calling `gtk_show_uri()`.

#### Parameters

func | a function called each time a GtkLinkButton is clicked, or `NULL`. | [allow-none]
data | user data to be passed to `func` , or `NULL`. | [allow-none]
destroy | a GDestroyNotify that gets called when `data` is no longer needed, or `NULL`. | [allow-none]

#### Returns

the previously set hook function.

Since: 2.10

### gtk_link_button_get_visited ()

    gboolean
    gtk_link_button_get_visited (GtkLinkButton *link_button);

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 again.

The state may also be changed using `gtk_link_button_set_visited()`.

#### Parameters

link_button | a GtkLinkButton |

#### Returns

`TRUE` if the link has been visited, `FALSE` otherwise

Since: 2.14

### gtk_link_button_set_visited ()

    void
    gtk_link_button_set_visited (GtkLinkButton *link_button,
                                 gboolean visited);

Sets the 'visited' state of the URI where the GtkLinkButton points. See `gtk_link_button_get_visited()` for more details.

#### Parameters

link_button | a GtkLinkButton |
visited | the new 'visited' state |

Since: 2.14

## Types and Values

### struct GtkLinkButton

    struct GtkLinkButton;

## Property Details

### The `“uri”` property

      “uri”                      gchar *

The URI bound to this button.

Flags: Read / Write

Default value: NULL

Since: 2.10

### The `“visited”` property

      “visited”                  gboolean

The 'visited' state of this button. A visited link is drawn in a different color.

Flags: Read / Write

Default value: FALSE

Since: 2.14