<?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="GtkCheckButton">
<refmeta>
<refentrytitle role="top_of_page" id="GtkCheckButton.top_of_page">GtkCheckButton</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkCheckButton</refname>
<refpurpose>Create widgets with a discrete toggle button</refpurpose>
</refnamediv>

<refsect1 id="GtkCheckButton.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-check-button-new">gtk_check_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-check-button-new-with-label">gtk_check_button_new_with_label</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-check-button-new-with-mnemonic">gtk_check_button_new_with_mnemonic</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-check-button-get-draw-indicator">gtk_check_button_get_draw_indicator</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-check-button-set-draw-indicator">gtk_check_button_set_draw_indicator</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-check-button-get-inconsistent">gtk_check_button_get_inconsistent</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-check-button-set-inconsistent">gtk_check_button_set_inconsistent</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCheckButton.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="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkCheckButton--draw-indicator">draw-indicator</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="GtkCheckButton--inconsistent">inconsistent</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCheckButton.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">struct</entry><entry role="function_name"><link linkend="GtkCheckButton-struct">GtkCheckButton</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCheckButton.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> <link linkend="GtkToggleButton">GtkToggleButton</link>
                    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkCheckButton
                        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkRadioButton">GtkRadioButton</link>
</screen>
</refsect1>
<refsect1 id="GtkCheckButton.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkCheckButton 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="GtkCheckButton.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkCheckButton.description" role="desc">
<title role="desc.title">Description</title>
<para>A <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link> places a discrete <link linkend="GtkToggleButton"><type>GtkToggleButton</type></link> next to a widget,
(usually a <link linkend="GtkLabel"><type>GtkLabel</type></link>). See the section on <link linkend="GtkToggleButton"><type>GtkToggleButton</type></link> widgets for
more information about toggle/check buttons.</para>
<para>The important signal ( <link linkend="GtkToggleButton-toggled"><type>“toggled”</type></link> ) is also inherited from
<link linkend="GtkToggleButton"><type>GtkToggleButton</type></link>.</para>
<refsect2><title>CSS nodes</title><informalexample><programlisting role="example"><![CDATA[
checkbutton
├── check
╰── <child>
]]></programlisting></informalexample>
<para></para>
<para>A GtkCheckButton with indicator (see <link linkend="gtk-check-button-set-draw-indicator"><function>gtk_check_button_set_draw_indicator()</function></link>) has a
main CSS node with name checkbutton and a subnode with name check.</para>
<informalexample><programlisting role="example"><![CDATA[
button.check
├── check
╰── <child>
]]></programlisting></informalexample>
<para></para>
<para>A GtkCheckButton without indicator changes the name of its main node
to button and adds a .check style class to it. The subnode is invisible
in this case.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkCheckButton.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-check-button-new" role="function">
<title>gtk_check_button_new&#160;()</title>
<indexterm zone="gtk-check-button-new"><primary>gtk_check_button_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_check_button_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link>.</para>
<refsect3 id="gtk-check-button-new.returns" role="returns">
<title>Returns</title>
<para> a <link linkend="GtkWidget"><type>GtkWidget</type></link>.</para>
</refsect3></refsect2>
<refsect2 id="gtk-check-button-new-with-label" role="function">
<title>gtk_check_button_new_with_label&#160;()</title>
<indexterm zone="gtk-check-button-new-with-label"><primary>gtk_check_button_new_with_label</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_check_button_new_with_label (<parameter>const <link linkend="gchar"><type>gchar</type></link> *label</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link> with a <link linkend="GtkLabel"><type>GtkLabel</type></link> to the right of it.</para>
<refsect3 id="gtk-check-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>label</para></entry>
<entry role="parameter_description"><para>the text for the check button.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-check-button-new-with-label.returns" role="returns">
<title>Returns</title>
<para> a <link linkend="GtkWidget"><type>GtkWidget</type></link>.</para>
</refsect3></refsect2>
<refsect2 id="gtk-check-button-new-with-mnemonic" role="function">
<title>gtk_check_button_new_with_mnemonic&#160;()</title>
<indexterm zone="gtk-check-button-new-with-mnemonic"><primary>gtk_check_button_new_with_mnemonic</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_check_button_new_with_mnemonic (<parameter>const <link linkend="gchar"><type>gchar</type></link> *label</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link> containing a label. The label
will be created using <link linkend="gtk-label-new-with-mnemonic"><function>gtk_label_new_with_mnemonic()</function></link>, so underscores
in <parameter>label</parameter>
 indicate the mnemonic for the check button.</para>
<refsect3 id="gtk-check-button-new-with-mnemonic.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>label</para></entry>
<entry role="parameter_description"><para>The text of the button, with an underscore in front of the
mnemonic character</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-check-button-new-with-mnemonic.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-check-button-get-draw-indicator" role="function">
<title>gtk_check_button_get_draw_indicator&#160;()</title>
<indexterm zone="gtk-check-button-get-draw-indicator"><primary>gtk_check_button_get_draw_indicator</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_check_button_get_draw_indicator (<parameter><link linkend="GtkCheckButton"><type>GtkCheckButton</type></link> *check_button</parameter>);</programlisting>
<para>Returns Whether or not the indicator part of the button gets drawn.</para>
<refsect3 id="gtk-check-button-get-draw-indicator.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>check_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-check-button-get-draw-indicator.returns" role="returns">
<title>Returns</title>
<para> The value of the GtkCheckButton:draw-indicator property.</para>
</refsect3></refsect2>
<refsect2 id="gtk-check-button-set-draw-indicator" role="function">
<title>gtk_check_button_set_draw_indicator&#160;()</title>
<indexterm zone="gtk-check-button-set-draw-indicator"><primary>gtk_check_button_set_draw_indicator</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_check_button_set_draw_indicator (<parameter><link linkend="GtkCheckButton"><type>GtkCheckButton</type></link> *check_button</parameter>,
                                     <parameter><link linkend="gboolean"><type>gboolean</type></link> draw_indicator</parameter>);</programlisting>
<para>Sets whether the indicator part of the button is drawn. This is important for
cases where the check button should have the functinality of a check button,
but the visuals of a regular button, like in a <link linkend="GtkStackSwitcher"><type>GtkStackSwitcher</type></link>.</para>
<refsect3 id="gtk-check-button-set-draw-indicator.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>check_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>draw_indicator</para></entry>
<entry role="parameter_description"><para>Whether or not to draw the indicator part of the button</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-check-button-get-inconsistent" role="function">
<title>gtk_check_button_get_inconsistent&#160;()</title>
<indexterm zone="gtk-check-button-get-inconsistent"><primary>gtk_check_button_get_inconsistent</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_check_button_get_inconsistent (<parameter><link linkend="GtkCheckButton"><type>GtkCheckButton</type></link> *check_button</parameter>);</programlisting>
<para>Returns whether the check button is in an inconsistent state.</para>
<refsect3 id="gtk-check-button-get-inconsistent.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>check_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-check-button-get-inconsistent.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>check_button</parameter>
is currently in an 'in between' state, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.</para>
</refsect3></refsect2>
<refsect2 id="gtk-check-button-set-inconsistent" role="function">
<title>gtk_check_button_set_inconsistent&#160;()</title>
<indexterm zone="gtk-check-button-set-inconsistent"><primary>gtk_check_button_set_inconsistent</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_check_button_set_inconsistent (<parameter><link linkend="GtkCheckButton"><type>GtkCheckButton</type></link> *check_button</parameter>,
                                   <parameter><link linkend="gboolean"><type>gboolean</type></link> inconsistent</parameter>);</programlisting>
<para>If the user has selected a range of elements (such as some text or
spreadsheet cells) that are affected by a check button, and the
current values in that range are inconsistent, you may want to
display the toggle in an "in between" state. Normally you would
turn off the inconsistent state again if the user checks the
check button. This has to be done manually,
gtk_check_button_set_inconsistent only affects visual appearance,
not the semantics of the button.</para>
<refsect3 id="gtk-check-button-set-inconsistent.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>check_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>inconsistent</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if state is inconsistent</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkCheckButton.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkCheckButton--draw-indicator" role="property"><title>The <literal>“draw-indicator”</literal> property</title>
<indexterm zone="GtkCheckButton--draw-indicator"><primary>GtkCheckButton:draw-indicator</primary></indexterm>
<programlisting>  “draw-indicator”           <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>If the indicator part of the button is displayed.</para><para>Owner: GtkCheckButton</para>
<para>Flags: Read / Write</para>
<para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkCheckButton--inconsistent" role="property"><title>The <literal>“inconsistent”</literal> property</title>
<indexterm zone="GtkCheckButton--inconsistent"><primary>GtkCheckButton:inconsistent</primary></indexterm>
<programlisting>  “inconsistent”             <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>If the check button is in an “in between” state.</para><para>Owner: GtkCheckButton</para>
<para>Flags: Read / Write</para>
<para>Default value: FALSE</para>
</refsect2>

</refsect1>
<refsect1 id="GtkCheckButton.see-also">
<title>See Also</title>
<para><link linkend="GtkCheckMenuItem"><type>GtkCheckMenuItem</type></link>, <link linkend="GtkButton"><type>GtkButton</type></link>, <link linkend="GtkToggleButton"><type>GtkToggleButton</type></link>, <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link></para>

</refsect1>

</refentry>
