| Top |
| CtkWidget * | ctk_link_button_new () |
| CtkWidget * | ctk_link_button_new_with_label () |
| const gchar * | ctk_link_button_get_uri () |
| void | ctk_link_button_set_uri () |
| gboolean | ctk_link_button_get_visited () |
| void | ctk_link_button_set_visited () |
GObject
╰── GInitiallyUnowned
╰── CtkWidget
╰── CtkContainer
╰── CtkBin
╰── CtkButton
╰── CtkLinkButton
CtkLinkButton implements AtkImplementorIface, CtkBuildable, CtkActionable and CtkActivatable.
A CtkLinkButton is a CtkButton 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 ctk_link_button_new() or
ctk_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 CtkLinkButton can be set specifically using
ctk_link_button_set_uri(), and retrieved using ctk_link_button_get_uri().
By default, CtkLinkButton calls ctk_show_uri_on_window() when the button is
clicked. This behaviour can be overridden by connecting to the
“activate-link” signal and returning TRUE from the
signal handler.
CtkLinkButton has a single CSS node with name button. To differentiate it from a plain CtkButton, it gets the .link style class.
CtkWidget *
ctk_link_button_new (const gchar *uri);
Creates a new CtkLinkButton with the URI as its text.
Since: 2.10
CtkWidget * ctk_link_button_new_with_label (const gchar *uri,const gchar *label);
Creates a new CtkLinkButton containing a label.
Since: 2.10
const gchar *
ctk_link_button_get_uri (CtkLinkButton *link_button);
Retrieves the URI set using ctk_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 ctk_link_button_set_uri (CtkLinkButton *link_button,const gchar *uri);
Sets uri
as the URI where the CtkLinkButton points. As a side-effect
this unsets the “visited” state of the button.
Since: 2.10
gboolean
ctk_link_button_get_visited (CtkLinkButton *link_button);
Retrieves the “visited” state of the URI where the CtkLinkButton 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 ctk_link_button_set_visited().
Since: 2.14
void ctk_link_button_set_visited (CtkLinkButton *link_button,gboolean visited);
Sets the “visited” state of the URI where the CtkLinkButton
points. See ctk_link_button_get_visited() for more details.
Since: 2.14
struct CtkLinkButton;
The CtkLinkButton contains only private data and should be accessed using the provided API.
struct CtkLinkButtonClass {
gboolean (* activate_link) (CtkLinkButton *button);
};
The CtkLinkButtonClass contains only private data.
“uri” property “uri” char *
The URI bound to this button.
Owner: CtkLinkButton
Flags: Read / Write
Default value: NULL
Since: 2.10
“activate-link” signalgboolean user_function (CtkLinkButton *button, gpointer user_data)
The ::activate-link signal is emitted each time the CtkLinkButton has been clicked.
The default handler will call ctk_show_uri_on_window() with the URI stored inside
the “uri” property.
To override the default behavior, you can connect to the ::activate-link
signal and stop the propagation of the signal by returning TRUE from
your handler.
button |
the CtkLinkButton that emitted the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last