<?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="GtkWindowControls">
<refmeta>
<refentrytitle role="top_of_page" id="GtkWindowControls.top_of_page">GtkWindowControls</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkWindowControls</refname>
<refpurpose>A widget displaying window buttons</refpurpose>
</refnamediv>

<refsect1 id="GtkWindowControls.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-window-controls-new">gtk_window_controls_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkPackType"><returnvalue>GtkPackType</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-window-controls-get-side">gtk_window_controls_get_side</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-window-controls-set-side">gtk_window_controls_set_side</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-window-controls-get-decoration-layout">gtk_window_controls_get_decoration_layout</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-window-controls-set-decoration-layout">gtk_window_controls_set_decoration_layout</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-window-controls-get-empty">gtk_window_controls_get_empty</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkWindowControls.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="GtkWindowControls--decoration-layout">decoration-layout</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="GtkWindowControls--empty">empty</link></entry><entry role="property_flags">Read</entry></row>
<row><entry role="property_type"><link linkend="GtkPackType"><type>GtkPackType</type></link></entry><entry role="property_name"><link linkend="GtkWindowControls--side">side</link></entry><entry role="property_flags">Read / Write</entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkWindowControls.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> GtkWindowControls
</screen>
</refsect1>
<refsect1 id="GtkWindowControls.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkWindowControls implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link> and  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link>.</para>

</refsect1>

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

<refsect1 id="GtkWindowControls.description" role="desc">
<title role="desc.title">Description</title>
<para>GtkWindowControls shows window frame controls, such as minimize, maximize
and close buttons, and the window icon.</para>
<para><link linkend="GtkWindowControls"><type>GtkWindowControls</type></link> only displays start or end side of the controls (see
<link linkend="GtkWindowControls--side"><type>“side”</type></link>), so it's intended to be always used in pair with
another <link linkend="GtkWindowControls"><type>GtkWindowControls</type></link> using the opposite side, for example:</para>
<informalexample><programlisting role="example"><![CDATA[
<object class="GtkBox">
  <child>
    <object class="GtkWindowControls">
      <property name="side">start</property>
    </object>
  </child>

  ...

  <child>
    <object class="GtkWindowControls">
      <property name="side">end</property>
    </object>
  </child>
</object>
]]></programlisting></informalexample>
<para></para>
<refsect2><title>CSS nodes</title><informalexample><programlisting role="example"><![CDATA[
windowcontrols
├── [image.icon]
├── [button.minimize]
├── [button.maximize]
╰── [button.close]
]]></programlisting></informalexample>
<para></para>
<para>A <link linkend="GtkWindowControls"><type>GtkWindowControls</type></link>' CSS node is called windowcontrols. It contains
subnodes corresponding to each title button. Which of the title buttons
exist and where they are placed exactly depends on the desktop environment
and <link linkend="GtkWindowControls--decoration-layout"><type>“decoration-layout”</type></link> value.</para>
<para>When <link linkend="GtkWindowControls--empty"><type>“empty”</type></link> is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, it gets the .empty style class.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkWindowControls.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-window-controls-new" role="function">
<title>gtk_window_controls_new&#160;()</title>
<indexterm zone="gtk-window-controls-new"><primary>gtk_window_controls_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_window_controls_new (<parameter><link linkend="GtkPackType"><type>GtkPackType</type></link> side</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkWindowControls"><type>GtkWindowControls</type></link>.</para>
<refsect3 id="gtk-window-controls-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>side</para></entry>
<entry role="parameter_description"><para>the side</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-window-controls-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkWindowControls"><type>GtkWindowControls</type></link>.</para>
</refsect3></refsect2>
<refsect2 id="gtk-window-controls-get-side" role="function">
<title>gtk_window_controls_get_side&#160;()</title>
<indexterm zone="gtk-window-controls-get-side"><primary>gtk_window_controls_get_side</primary></indexterm>
<programlisting language="C"><link linkend="GtkPackType"><returnvalue>GtkPackType</returnvalue></link>
gtk_window_controls_get_side (<parameter><link linkend="GtkWindowControls"><type>GtkWindowControls</type></link> *self</parameter>);</programlisting>
<para>Gets the side set with <link linkend="gtk-window-controls-set-side"><function>gtk_window_controls_set_side()</function></link>.</para>
<refsect3 id="gtk-window-controls-get-side.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="GtkWindowControls"><type>GtkWindowControls</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-window-controls-get-side.returns" role="returns">
<title>Returns</title>
<para> the side</para>
</refsect3></refsect2>
<refsect2 id="gtk-window-controls-set-side" role="function">
<title>gtk_window_controls_set_side&#160;()</title>
<indexterm zone="gtk-window-controls-set-side"><primary>gtk_window_controls_set_side</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_window_controls_set_side (<parameter><link linkend="GtkWindowControls"><type>GtkWindowControls</type></link> *self</parameter>,
                              <parameter><link linkend="GtkPackType"><type>GtkPackType</type></link> side</parameter>);</programlisting>
<para>Sets the side for <parameter>self</parameter>
, determining which part of decoration layout it uses.</para>
<para>See <link linkend="gtk-window-controls-set-decoration-layout"><function>gtk_window_controls_set_decoration_layout()</function></link></para>
<refsect3 id="gtk-window-controls-set-side.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="GtkWindowControls"><type>GtkWindowControls</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>side</para></entry>
<entry role="parameter_description"><para>a side</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-window-controls-get-decoration-layout" role="function">
<title>gtk_window_controls_get_decoration_layout&#160;()</title>
<indexterm zone="gtk-window-controls-get-decoration-layout"><primary>gtk_window_controls_get_decoration_layout</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
gtk_window_controls_get_decoration_layout
                               (<parameter><link linkend="GtkWindowControls"><type>GtkWindowControls</type></link> *self</parameter>);</programlisting>
<para>Gets the decoration layout set with
<link linkend="gtk-window-controls-set-decoration-layout"><function>gtk_window_controls_set_decoration_layout()</function></link>.</para>
<refsect3 id="gtk-window-controls-get-decoration-layout.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="GtkWindowControls"><type>GtkWindowControls</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-window-controls-get-decoration-layout.returns" role="returns">
<title>Returns</title>
<para> the decoration layout</para>
</refsect3></refsect2>
<refsect2 id="gtk-window-controls-set-decoration-layout" role="function">
<title>gtk_window_controls_set_decoration_layout&#160;()</title>
<indexterm zone="gtk-window-controls-set-decoration-layout"><primary>gtk_window_controls_set_decoration_layout</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_window_controls_set_decoration_layout
                               (<parameter><link linkend="GtkWindowControls"><type>GtkWindowControls</type></link> *self</parameter>,
                                <parameter>const <link linkend="char"><type>char</type></link> *layout</parameter>);</programlisting>
<para>Sets the decoration layout for the title buttons, overriding
the <link linkend="GtkSettings--gtk-decoration-layout"><type>“gtk-decoration-layout”</type></link> setting.</para>
<para>The format of the string is button names, separated by commas.
A colon separates the buttons that should appear on the left
from those on the right. Recognized button names are minimize,
maximize, close and icon (the window icon).</para>
<para>For example, “icon:minimize,maximize,close” specifies a icon
on the left, and minimize, maximize and close buttons on the right.</para>
<para>If <link linkend="GtkWindowControls--side"><type>“side”</type></link> value is <parameter>GTK_PACK_START</parameter>
, <parameter>self</parameter>
 will
display the part before the colon, otherwise after that.</para>
<refsect3 id="gtk-window-controls-set-decoration-layout.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="GtkWindowControls"><type>GtkWindowControls</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>layout</para></entry>
<entry role="parameter_description"><para>a decoration layout, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to
unset the layout. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-window-controls-get-empty" role="function">
<title>gtk_window_controls_get_empty&#160;()</title>
<indexterm zone="gtk-window-controls-get-empty"><primary>gtk_window_controls_get_empty</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_window_controls_get_empty (<parameter><link linkend="GtkWindowControls"><type>GtkWindowControls</type></link> *self</parameter>);</programlisting>
<para>Gets whether the widget has any window buttons.</para>
<refsect3 id="gtk-window-controls-get-empty.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="GtkWindowControls"><type>GtkWindowControls</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-window-controls-get-empty.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the widget has window buttons, otherwise <link linkend="FALSE:CAPS"><literal>FALSE</literal></link></para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkWindowControls.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkWindowControls--decoration-layout" role="property"><title>The <literal>“decoration-layout”</literal> property</title>
<indexterm zone="GtkWindowControls--decoration-layout"><primary>GtkWindowControls:decoration-layout</primary></indexterm>
<programlisting>  “decoration-layout”        <link linkend="gchar"><type>gchar</type></link>&#160;*</programlisting>
<para>The decoration layout for window buttons. If this property is not set,
the <link linkend="GtkSettings--gtk-decoration-layout"><type>“gtk-decoration-layout”</type></link> setting is used.</para>
<para>See <link linkend="gtk-window-controls-set-decoration-layout"><function>gtk_window_controls_set_decoration_layout()</function></link> for information
about the format of this string.</para>
<para>Owner: GtkWindowControls</para>
<para>Flags: Read / Write</para>
<para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkWindowControls--empty" role="property"><title>The <literal>“empty”</literal> property</title>
<indexterm zone="GtkWindowControls--empty"><primary>GtkWindowControls:empty</primary></indexterm>
<programlisting>  “empty”                    <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the widget has any window buttons.</para>
<para>Owner: GtkWindowControls</para>
<para>Flags: Read</para>
<para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkWindowControls--side" role="property"><title>The <literal>“side”</literal> property</title>
<indexterm zone="GtkWindowControls--side"><primary>GtkWindowControls:side</primary></indexterm>
<programlisting>  “side”                     <link linkend="GtkPackType"><type>GtkPackType</type></link></programlisting>
<para>Whether the widget shows start or end side of the decoration layout.</para>
<para>See <link linkend="gtk-window-controls-set-decoration-layout"><function>gtk_window_controls_set_decoration_layout()</function></link>.</para>
<para>Owner: GtkWindowControls</para>
<para>Flags: Read / Write</para>
<para>Default value: GTK_PACK_START</para>
</refsect2>

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

</refsect1>

</refentry>
