Top |
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 () |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkButton ╰── GtkLinkButton
GtkLinkButton implements AtkImplementorIface, GtkBuildable and GtkActivatable.
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()
.
GtkLinkButton was added in GTK+ 2.10.
GtkWidget *
gtk_link_button_new (const gchar *uri
);
Creates a new GtkLinkButton with the URI as its text.
Since: 2.10
GtkWidget * gtk_link_button_new_with_label (const gchar *uri
,const gchar *label
);
Creates a new GtkLinkButton containing a label.
Since: 2.10
const gchar *
gtk_link_button_get_uri (GtkLinkButton *link_button
);
Retrieves the URI set using gtk_link_button_set_uri()
.
a valid URI. The returned string is owned by the link button and should not be modified or freed.
Since: 2.10
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.
Since: 2.10
void (*GtkLinkButtonUriFunc) (GtkLinkButton *button
,const gchar *link_
,gpointer user_data
);
The type of a function which is called when the GtkLinkButton is clicked.
button |
the GtkLinkButton which was clicked |
|
link_ |
the URI to which the clicked GtkLinkButton points |
|
user_data |
user data that was passed when the function was registered
with |
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()
.
func |
a function called each time a GtkLinkButton is clicked, or |
[allow-none] |
data |
user data to be passed to |
[allow-none] |
destroy |
a GDestroyNotify that gets called when |
[allow-none] |
Since: 2.10
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()
.
Since: 2.14
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.
Since: 2.14
struct GtkLinkButton;
The GtkLinkButton struct contains private data only, and should be manipulated using the functions below.