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_uri | Retrieves the URI set using gtk_link_button_set_uri(). |
get_visited | Retrieves the 'visited' state of the URI where the GtkLinkButton points. |
new_with_label | Creates a new GtkLinkButton containing a label. |
set_uri | Sets uri as the URI where the GtkLinkButton points. |
set_uri_hook | Sets func as the function that should be invoked every time a user clicks a GtkLinkButton. |
set_visited | Sets the 'visited' state of the URI where the GtkLinkButton points. |
Retrieves the URI set using gtk_link_button_set_uri().
GtkLinkButton.get_uri()
Return | a valid URI |
Retrieves the 'visited' state of the URI where the GtkLinkButton points.
GtkLinkButton.get_visited()
Return | TRUE 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().
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). |
Return | a new link button widget |
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.
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().
Sets the 'visited' state of the URI where the GtkLinkButton points.
GtkLinkButton.set_visited( visited )
visited | the new 'visited' state |