gtk.LinkButton
Prev | The gtk Class Reference | Next

## gtk.LinkButton

gtk.LinkButton — a button bound to a URL (new in PyGTK 2.10)

## Synopsis

    class gtk.LinkButton(gtk.Button):
        gtk.LinkButton(uri, label=None)
        def get_uri()
        def set_uri(uri)

    Functions

        def gtk.link_button_set_uri_hook(func, data=None)

## Ancestry

    +-- gobject.GObject
      +-- gtk.Object
        +-- gtk.Widget
          +-- gtk.Container
            +-- gtk.Bin
              +-- gtk.Button
                +-- gtk.LinkButton

## gtk.LinkButton Properties

gtk.Object Properties

gtk.Widget Properties

gtk.Container Properties

gtk.Button Properties

"uri" | Read-Write | The URI bound to this button. Available in GTK+ 2.10.

## gtk.LinkButton Style Properties

gtk.Widget Style Properties

gtk.Button Style Properties

## gtk.LinkButton Signal Prototypes

gobject.GObject Signal Prototypes

gtk.Object Signal Prototypes

gtk.Widget Signal Prototypes

gtk.Container Signal Prototypes

gtk.Button Signal Prototypes

## Description

### Note

The `gtk.LinkButton` is available in PyGTK 2.10 and above.

A `gtk.LinkButton` is a `gtk.Button` with a hyperlink, similar to the one used by web browsers, that triggers an action when clicked. It is useful to show quick links to resources.

A link button is created by calling the gtk.LinkButton constructor. The URI you pass to the constructor is used as a label for the widget.

The URI bound to a `gtk.LinkButton` can be set specifically using the `set_uri`()) method, and retrieved using the `get_uri`() method.

`gtk.LinkButton` offers a global hook, which is called when the used clicks on it: see the `gtk.link_button_set_uri_hook`() function.

## Constructor

### gtk.LinkButton

        gtk.LinkButton(uri, label=None)

`uri` : | a valid URI
`label` : | the text of the button or `None`
Returns : | a new link button widget.

### Note

This constructor is available in PyGTK 2.10 and above.

Creates a new `gtk.LinkButton` with the URI specified by `uri` as its text if `label` is `None`. If `label` is not `None`, it is used as the text of the button.

## Methods

### gtk.LinkButton.get_uri

        def get_uri()

Returns : | the associated URI.

### Note

This method is available in PyGTK 2.10 and above.

The `get_uri`() method returns the URI set using the `gtk.LinkButton.set_uri()` method or the gtk.LinkButton() constructor.

### gtk.LinkButton.set_uri

        def set_uri(uri)

`uri` : | a valid URI

### Note

This method is available in PyGTK 2.10 and above.

The `set_uri`() method sets the string specified by `uri` as the URI the `gtk.LinkButton` points to.

## Functions

### gtk.link_button_set_uri_hook

        def gtk.link_button_set_uri_hook(func, data=None)

`func` : | a function called each time a `gtk.LinkButton` is clicked, or `None`
`data` : | user data to be passed to `func`

### Note

This function is available in PyGTK 2.10 and above.

The `gtk.link_button_set_uri_hook`() function sets `func` as the function that should be invoked every time a user clicks a `gtk.LinkButton`. This function is called before every callback registered for the "clicked" signal. If `func` is `None` the current callback function will be removed.

Prev | Up | Next
gtk.Layout | Home | gtk.ListStore