<?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="gtk4-GtkCenterBox">
<refmeta>
<refentrytitle role="top_of_page" id="gtk4-GtkCenterBox.top_of_page">GtkCenterBox</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkCenterBox</refname>
<refpurpose>A centering container</refpurpose>
</refnamediv>

<refsect1 id="gtk4-GtkCenterBox.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-center-box-new">gtk_center_box_new</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-center-box-set-start-widget">gtk_center_box_set_start_widget</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-center-box-set-center-widget">gtk_center_box_set_center_widget</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-center-box-set-end-widget">gtk_center_box_set_end_widget</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-center-box-get-start-widget">gtk_center_box_get_start_widget</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-center-box-get-center-widget">gtk_center_box_get_center_widget</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-center-box-get-end-widget">gtk_center_box_get_end_widget</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-center-box-set-baseline-position">gtk_center_box_set_baseline_position</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkBaselinePosition"><returnvalue>GtkBaselinePosition</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-center-box-get-baseline-position">gtk_center_box_get_baseline_position</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gtk4-GtkCenterBox.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="GtkCenterBox">GtkCenterBox</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

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

<refsect1 id="gtk4-GtkCenterBox.description" role="desc">
<title role="desc.title">Description</title>
<para>The GtkCenterBox widget arranges three children in a horizontal
or vertical arrangement, keeping the middle child centered as well
as possible.</para>
<para>To add children to GtkCenterBox, use <link linkend="gtk-center-box-set-start-widget"><function>gtk_center_box_set_start_widget()</function></link>,
<link linkend="gtk-center-box-set-center-widget"><function>gtk_center_box_set_center_widget()</function></link> and <link linkend="gtk-center-box-set-end-widget"><function>gtk_center_box_set_end_widget()</function></link>.</para>
<para>The sizing and positioning of children can be influenced with the
align and expand properties of the children.</para>
<refsect2><title>GtkCenterBox as GtkBuildable</title><para>The GtkCenterBox implementation of the <link linkend="GtkBuildable"><type>GtkBuildable</type></link> interface supports
placing children in the 3 positions by specifying “start”, “center” or
“end” as the “type” attribute of a &lt;child> element.</para>
</refsect2>
<refsect2><title>CSS nodes</title><para>GtkCenterBox uses a single CSS node with the name “box”,</para>
<para>The first child of the <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> will be allocated depending on the
text direction, i.e. in left-to-right layouts it will be allocated on the
left and in right-to-left layouts on the right.</para>
<para>In vertical orientation, the nodes of the children are arranged from top to
bottom.</para>
</refsect2>

</refsect1>
<refsect1 id="gtk4-GtkCenterBox.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-center-box-new" role="function">
<title>gtk_center_box_new&#160;()</title>
<indexterm zone="gtk-center-box-new"><primary>gtk_center_box_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_center_box_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link>.</para>
<refsect3 id="gtk-center-box-new.returns" role="returns">
<title>Returns</title>
<para> the new <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link>.</para>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-set-start-widget" role="function">
<title>gtk_center_box_set_start_widget&#160;()</title>
<indexterm zone="gtk-center-box-set-start-widget"><primary>gtk_center_box_set_start_widget</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_center_box_set_start_widget (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>,
                                 <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *child</parameter>);</programlisting>
<para>Sets the start widget. To remove the existing start widget, pass <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="gtk-center-box-set-start-widget.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>child</para></entry>
<entry role="parameter_description"><para>the new start widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-set-center-widget" role="function">
<title>gtk_center_box_set_center_widget&#160;()</title>
<indexterm zone="gtk-center-box-set-center-widget"><primary>gtk_center_box_set_center_widget</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_center_box_set_center_widget (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>,
                                  <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *child</parameter>);</programlisting>
<para>Sets the center widget. To remove the existing center widget, pas <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="gtk-center-box-set-center-widget.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>child</para></entry>
<entry role="parameter_description"><para>the new center widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-set-end-widget" role="function">
<title>gtk_center_box_set_end_widget&#160;()</title>
<indexterm zone="gtk-center-box-set-end-widget"><primary>gtk_center_box_set_end_widget</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_center_box_set_end_widget (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>,
                               <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *child</parameter>);</programlisting>
<para>Sets the end widget. To remove the existing end widget, pass <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="gtk-center-box-set-end-widget.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>child</para></entry>
<entry role="parameter_description"><para>the new end widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-get-start-widget" role="function">
<title>gtk_center_box_get_start_widget&#160;()</title>
<indexterm zone="gtk-center-box-get-start-widget"><primary>gtk_center_box_get_start_widget</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_center_box_get_start_widget (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>);</programlisting>
<para>Gets the start widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there is none.</para>
<refsect3 id="gtk-center-box-get-start-widget.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-center-box-get-start-widget.returns" role="returns">
<title>Returns</title>
<para>the start widget. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-get-center-widget" role="function">
<title>gtk_center_box_get_center_widget&#160;()</title>
<indexterm zone="gtk-center-box-get-center-widget"><primary>gtk_center_box_get_center_widget</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_center_box_get_center_widget (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>);</programlisting>
<para>Gets the center widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there is none.</para>
<refsect3 id="gtk-center-box-get-center-widget.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-center-box-get-center-widget.returns" role="returns">
<title>Returns</title>
<para>the center widget. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-get-end-widget" role="function">
<title>gtk_center_box_get_end_widget&#160;()</title>
<indexterm zone="gtk-center-box-get-end-widget"><primary>gtk_center_box_get_end_widget</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_center_box_get_end_widget (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>);</programlisting>
<para>Gets the end widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there is none.</para>
<refsect3 id="gtk-center-box-get-end-widget.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-center-box-get-end-widget.returns" role="returns">
<title>Returns</title>
<para>the end widget. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-set-baseline-position" role="function">
<title>gtk_center_box_set_baseline_position&#160;()</title>
<indexterm zone="gtk-center-box-set-baseline-position"><primary>gtk_center_box_set_baseline_position</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_center_box_set_baseline_position (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>,
                                      <parameter><link linkend="GtkBaselinePosition"><type>GtkBaselinePosition</type></link> position</parameter>);</programlisting>
<para>Sets the baseline position of a center box.</para>
<para>This affects only horizontal boxes with at least one baseline
aligned child. If there is more vertical space available than
requested, and the baseline is not allocated by the parent then
<parameter>position</parameter>
 is used to allocate the baseline wrt. the extra space
available.</para>
<refsect3 id="gtk-center-box-set-baseline-position.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkBaselinePosition"><type>GtkBaselinePosition</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-center-box-get-baseline-position" role="function">
<title>gtk_center_box_get_baseline_position&#160;()</title>
<indexterm zone="gtk-center-box-get-baseline-position"><primary>gtk_center_box_get_baseline_position</primary></indexterm>
<programlisting language="C"><link linkend="GtkBaselinePosition"><returnvalue>GtkBaselinePosition</returnvalue></link>
gtk_center_box_get_baseline_position (<parameter><link linkend="GtkCenterBox"><type>GtkCenterBox</type></link> *self</parameter>);</programlisting>
<para>Gets the value set by <link linkend="gtk-center-box-set-baseline-position"><function>gtk_center_box_set_baseline_position()</function></link>.</para>
<refsect3 id="gtk-center-box-get-baseline-position.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCenterBox"><type>GtkCenterBox</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-center-box-get-baseline-position.returns" role="returns">
<title>Returns</title>
<para> the baseline position</para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="gtk4-GtkCenterBox.see-also">
<title>See Also</title>
<para><link linkend="GtkBox"><type>GtkBox</type></link></para>

</refsect1>

</refentry>
