![]() |
![]() |
![]() |
GTK+ Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <gtk/gtk.h> GtkLinkButton; GtkWidget * gtk_link_button_new (const gchar *uri
); GtkWidget * gtk_link_button_new_with_label (const gchar *uri
,const gchar *label
); const gchar * gtk_link_button_get_uri (GtkLinkButton *link_button
); void gtk_link_button_set_uri (GtkLinkButton *link_button
,const gchar *uri
); gboolean gtk_link_button_get_visited (GtkLinkButton *link_button
); void gtk_link_button_set_visited (GtkLinkButton *link_button
,gboolean visited
);
GObject +----GInitiallyUnowned +----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()
.
By default, GtkLinkButton calls gtk_show_uri()
when the button is
clicked. This behaviour can be overridden by connecting to the
"clicked" signal.
GtkWidget * gtk_link_button_new (const gchar *uri
);
Creates a new GtkLinkButton with the URI as its text.
|
a valid URI |
Returns : |
a new link button widget. |
Since 2.10
GtkWidget * gtk_link_button_new_with_label (const gchar *uri
,const gchar *label
);
Creates a new GtkLinkButton containing a label.
|
a valid URI |
|
the text of the button. [allow-none] |
Returns : |
a new link button widget. [transfer none] |
Since 2.10
const gchar * gtk_link_button_get_uri (GtkLinkButton *link_button
);
Retrieves the URI set using gtk_link_button_set_uri()
.
|
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
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.
|
a GtkLinkButton |
|
a valid URI |
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()
.
|
a GtkLinkButton |
Returns : |
TRUE if the link has been visited, FALSE otherwise
|
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.
|
a GtkLinkButton |
|
the new 'visited' state |
Since 2.14