11.80Class GtkLinkButton

Create buttons bound to a URL

Class GtkLinkButton( uri )
uri a valid URI string

A GtkLinkButton is a GtkButton 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 GtkLinkButton can be set specifically using gtk_link_button_set_uri(), and retrieved using gtk_link_button_get_uri().

GtkLinkButton offers a global hook, which is called when the used clicks on it: see gtk_link_button_set_uri_hook().

Methods
get_uriRetrieves the URI set using gtk_link_button_set_uri().
get_visitedRetrieves the 'visited' state of the URI where the GtkLinkButton points.
new_with_labelCreates a new GtkLinkButton containing a label.
set_uriSets uri as the URI where the GtkLinkButton points.
set_uri_hookSets func as the function that should be invoked every time a user clicks a GtkLinkButton.
set_visitedSets the 'visited' state of the URI where the GtkLinkButton points.

Methods

get_uri

Retrieves the URI set using gtk_link_button_set_uri().

GtkLinkButton.get_uri()
Returna valid URI

get_visited

Retrieves the 'visited' state of the URI where the GtkLinkButton points.

GtkLinkButton.get_visited()
ReturnTRUE if the link has been visited, FALSE otherwise

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().

new_with_label

Creates a new GtkLinkButton containing a label.

GtkLinkButton.new_with_label( uri, label )
uri a valid URI
label the text of the button (or nil).
Returna new link button widget

set_uri

Sets uri as the URI where the GtkLinkButton points.

GtkLinkButton.set_uri( uri )
uri a valid URI.

As a side-effect this unsets the 'visited' state of the button.

set_uri_hook

Sets func as the function that should be invoked every time a user clicks a GtkLinkButton.

GtkLinkButton.set_uri_hook( func, user )
func a function called each time a GtkLinkButton is clicked, or NULL.
user data to be passed to func, or NULL.

This function is called before every callback registered for the "clicked" signal.

The function will get the button object as first parameter, the activated link as second parameter (string), and user data as third parameter.

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

set_visited

Sets the 'visited' state of the URI where the GtkLinkButton points.

GtkLinkButton.set_visited( visited )
visited the new 'visited' state
Made with http://www.falconpl.org