<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkLinkButton">
<refmeta>
<refentrytitle role="top_of_page" id="GtkLinkButton.top_of_page">GtkLinkButton</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkLinkButton</refname>
<refpurpose>Create buttons bound to a URL</refpurpose>
</refnamediv>

<refsect1 id="GtkLinkButton.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-link-button-new">gtk_link_button_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-link-button-new-with-label">gtk_link_button_new_with_label</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-link-button-get-uri">gtk_link_button_get_uri</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-link-button-set-uri">gtk_link_button_set_uri</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-link-button-get-visited">gtk_link_button_get_visited</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-link-button-set-visited">gtk_link_button_set_visited</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkLinkButton.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="gchar"><type>gchar</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkLinkButton--uri">uri</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkLinkButton--visited">visited</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkLinkButton.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkLinkButton-activate-link">activate-link</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkLinkButton.actions" role="actions">
<title role="actions.title">Actions</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="actions_none" colwidth="150px"/>
<colspec colname="actions_name" colwidth="300px"/>
<colspec colname="actions_param" colwidth="200px"/>
<tbody>
<row><entry></entry><entry role="action_name"><link linkend="GtkLinkButton|menu.popup">menu.popup</link></entry><entry role="parameter_type"></entry></row>
<row><entry></entry><entry role="action_name"><link linkend="GtkLinkButton|clipboard.copy">clipboard.copy</link></entry><entry role="parameter_type"></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkLinkButton.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkLinkButton-struct">GtkLinkButton</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkLinkButton.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkButton">GtkButton</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkLinkButton
</screen>
</refsect1>
<refsect1 id="GtkLinkButton.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkLinkButton implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link>,  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link> and  <link linkend="GtkActionable">GtkActionable</link>.</para>

</refsect1>

<refsect1 id="GtkLinkButton.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkLinkButton.description" role="desc">
<title role="desc.title">Description</title>
<para>A GtkLinkButton is a <link linkend="GtkButton"><type>GtkButton</type></link> 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.</para>
<para>A link button is created by calling either <link linkend="gtk-link-button-new"><function>gtk_link_button_new()</function></link> or
<link linkend="gtk-link-button-new-with-label"><function>gtk_link_button_new_with_label()</function></link>. If using the former, the URI you pass
to the constructor is used as a label for the widget.</para>
<para>The URI bound to a GtkLinkButton can be set specifically using
<link linkend="gtk-link-button-set-uri"><function>gtk_link_button_set_uri()</function></link>, and retrieved using <link linkend="gtk-link-button-get-uri"><function>gtk_link_button_get_uri()</function></link>.</para>
<para>By default, GtkLinkButton calls <link linkend="gtk-show-uri"><function>gtk_show_uri()</function></link> when the button is
clicked. This behaviour can be overridden by connecting to the
<link linkend="GtkLinkButton-activate-link"><type>“activate-link”</type></link> signal and returning <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> from the
signal handler.</para>
<refsect2><title>CSS nodes</title><para>GtkLinkButton has a single CSS node with name button. To differentiate
it from a plain <link linkend="GtkButton"><type>GtkButton</type></link>, it gets the .link style class.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkLinkButton.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-link-button-new" role="function">
<title>gtk_link_button_new&#160;()</title>
<indexterm zone="gtk-link-button-new"><primary>gtk_link_button_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_link_button_new (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> with the URI as its text.</para>
<refsect3 id="gtk-link-button-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a valid URI</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-link-button-new.returns" role="returns">
<title>Returns</title>
<para> a new link button widget.</para>
</refsect3></refsect2>
<refsect2 id="gtk-link-button-new-with-label" role="function">
<title>gtk_link_button_new_with_label&#160;()</title>
<indexterm zone="gtk-link-button-new-with-label"><primary>gtk_link_button_new_with_label</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_link_button_new_with_label (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>,
                                <parameter>const <link linkend="gchar"><type>gchar</type></link> *label</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> containing a label.</para>
<refsect3 id="gtk-link-button-new-with-label.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a valid URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>label</para></entry>
<entry role="parameter_description"><para>the text of the button. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-link-button-new-with-label.returns" role="returns">
<title>Returns</title>
<para>a new link button widget. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-link-button-get-uri" role="function">
<title>gtk_link_button_get_uri&#160;()</title>
<indexterm zone="gtk-link-button-get-uri"><primary>gtk_link_button_get_uri</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
gtk_link_button_get_uri (<parameter><link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> *link_button</parameter>);</programlisting>
<para>Retrieves the URI set using <link linkend="gtk-link-button-set-uri"><function>gtk_link_button_set_uri()</function></link>.</para>
<refsect3 id="gtk-link-button-get-uri.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>link_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-link-button-get-uri.returns" role="returns">
<title>Returns</title>
<para> a valid URI.  The returned string is owned by the link button
and should not be modified or freed.</para>
</refsect3></refsect2>
<refsect2 id="gtk-link-button-set-uri" role="function">
<title>gtk_link_button_set_uri&#160;()</title>
<indexterm zone="gtk-link-button-set-uri"><primary>gtk_link_button_set_uri</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_link_button_set_uri (<parameter><link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> *link_button</parameter>,
                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>);</programlisting>
<para>Sets <parameter>uri</parameter>
 as the URI where the <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> points. As a side-effect
this unsets the “visited” state of the button.</para>
<refsect3 id="gtk-link-button-set-uri.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>link_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a valid URI</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-link-button-get-visited" role="function">
<title>gtk_link_button_get_visited&#160;()</title>
<indexterm zone="gtk-link-button-get-visited"><primary>gtk_link_button_get_visited</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_link_button_get_visited (<parameter><link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> *link_button</parameter>);</programlisting>
<para>Retrieves the “visited” state of the URI where the <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link>
points. The button becomes visited when it is clicked. If the URI
is changed on the button, the “visited” state is unset again.</para>
<para>The state may also be changed using <link linkend="gtk-link-button-set-visited"><function>gtk_link_button_set_visited()</function></link>.</para>
<refsect3 id="gtk-link-button-get-visited.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>link_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-link-button-get-visited.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the link has been visited, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3></refsect2>
<refsect2 id="gtk-link-button-set-visited" role="function">
<title>gtk_link_button_set_visited&#160;()</title>
<indexterm zone="gtk-link-button-set-visited"><primary>gtk_link_button_set_visited</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_link_button_set_visited (<parameter><link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> *link_button</parameter>,
                             <parameter><link linkend="gboolean"><type>gboolean</type></link> visited</parameter>);</programlisting>
<para>Sets the “visited” state of the URI where the <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link>
points.  See <link linkend="gtk-link-button-get-visited"><function>gtk_link_button_get_visited()</function></link> for more details.</para>
<refsect3 id="gtk-link-button-set-visited.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>link_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>visited</para></entry>
<entry role="parameter_description"><para>the new “visited” state</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkLinkButton.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkLinkButton-struct" role="struct">
<title>GtkLinkButton</title>
<indexterm zone="GtkLinkButton-struct"><primary>GtkLinkButton</primary></indexterm>
<programlisting language="C">typedef struct _GtkLinkButton GtkLinkButton;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkLinkButton.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkLinkButton--uri" role="property"><title>The <literal>“uri”</literal> property</title>
<indexterm zone="GtkLinkButton--uri"><primary>GtkLinkButton:uri</primary></indexterm>
<programlisting>  “uri”                      <link linkend="gchar"><type>gchar</type></link>&#160;*</programlisting>
<para>The URI bound to this button.</para>
<para>Owner: GtkLinkButton</para>
<para>Flags: Read / Write</para>
<para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkLinkButton--visited" role="property"><title>The <literal>“visited”</literal> property</title>
<indexterm zone="GtkLinkButton--visited"><primary>GtkLinkButton:visited</primary></indexterm>
<programlisting>  “visited”                  <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>The 'visited' state of this button. A visited link is drawn in a
different color.</para>
<para>Owner: GtkLinkButton</para>
<para>Flags: Read / Write</para>
<para>Default value: FALSE</para>
</refsect2>

</refsect1>
<refsect1 id="GtkLinkButton.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkLinkButton-activate-link" role="signal"><title>The <literal>“activate-link”</literal> signal</title>
<indexterm zone="GtkLinkButton-activate-link"><primary>GtkLinkButton::activate-link</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
user_function (<link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> *button,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>The ::activate-link signal is emitted each time the <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link>
has been clicked.</para>
<para>The default handler will call <link linkend="gtk-show-uri"><function>gtk_show_uri()</function></link> with the URI stored inside
the <link linkend="GtkLinkButton--uri"><type>“uri”</type></link> property.</para>
<para>To override the default behavior, you can connect to the ::activate-link
signal and stop the propagation of the signal by returning <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> from
your handler.</para>
<refsect3 id="GtkLinkButton-activate-link.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>button</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkLinkButton"><type>GtkLinkButton</type></link> that emitted the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>
<refsect1 id="GtkLinkButton.action-details" role="action_details">
<title role="action_details.title">Action Details</title>
<refsect2 id="GtkLinkButton|menu.popup" role="action"><title>The <literal>“menu.popup”</literal> action</title>
<indexterm zone="GtkLinkButton|menu.popup"><primary>GtkLinkButton|menu.popup</primary></indexterm>
<para>Opens the context menu.</para>
</refsect2>
<refsect2 id="GtkLinkButton|clipboard.copy" role="action"><title>The <literal>“clipboard.copy”</literal> action</title>
<indexterm zone="GtkLinkButton|clipboard.copy"><primary>GtkLinkButton|clipboard.copy</primary></indexterm>
<para>Copies the url to the clipboard.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkLinkButton.see-also">
<title>See Also</title>
<para><link linkend="GtkButton"><type>GtkButton</type></link></para>

</refsect1>

</refentry>
