<?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="GtkApplicationWindow">
<refmeta>
<refentrytitle role="top_of_page" id="GtkApplicationWindow.top_of_page">GtkApplicationWindow</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkApplicationWindow</refname>
<refpurpose>GtkWindow subclass with GtkApplication support</refpurpose>
</refnamediv>

<refsect1 id="GtkApplicationWindow.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-application-window-new">gtk_application_window_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-application-window-set-show-menubar">gtk_application_window_set_show_menubar</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-application-window-get-show-menubar">gtk_application_window_get_show_menubar</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-application-window-get-id">gtk_application_window_get_id</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-application-window-set-help-overlay">gtk_application_window_set_help_overlay</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkShortcutsWindow"><returnvalue>GtkShortcutsWindow</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-application-window-get-help-overlay">gtk_application_window_get_help_overlay</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkApplicationWindow.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="GtkApplicationWindow--show-menubar">show-menubar</link></entry><entry role="property_flags">Read / Write / Construct</entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkApplicationWindow.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="GtkWindow">GtkWindow</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkApplicationWindow
</screen>
</refsect1>
<refsect1 id="GtkApplicationWindow.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkApplicationWindow implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link>,  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link>,  <link linkend="GtkNative">GtkNative</link>,  <link linkend="GtkShortcutManager">GtkShortcutManager</link>,  <link linkend="GtkRoot">GtkRoot</link>,  <link linkend="GActionGroup">GActionGroup</link> and  <link linkend="GActionMap">GActionMap</link>.</para>

</refsect1>

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

<refsect1 id="GtkApplicationWindow.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link> is a <link linkend="GtkWindow"><type>GtkWindow</type></link> subclass that offers some
extra functionality for better integration with <link linkend="GtkApplication"><type>GtkApplication</type></link>
features.  Notably, it can handle both the application menu as well
as the menubar. See <link linkend="gtk-application-set-app-menu"><function>gtk_application_set_app_menu()</function></link> and
<link linkend="gtk-application-set-menubar"><function>gtk_application_set_menubar()</function></link>.</para>
<para>This class implements the <link linkend="GActionGroup"><type>GActionGroup</type></link> and <link linkend="GActionMap"><type>GActionMap</type></link> interfaces,
to let you add window-specific actions that will be exported by the
associated <link linkend="GtkApplication"><type>GtkApplication</type></link>, together with its application-wide
actions.  Window-specific actions are prefixed with the “win.”
prefix and application-wide actions are prefixed with the “app.”
prefix.  Actions must be addressed with the prefixed name when
referring to them from a <link linkend="GMenuModel"><type>GMenuModel</type></link>.</para>
<para>Note that widgets that are placed inside a <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link>
can also activate these actions, if they implement the
<link linkend="GtkActionable"><type>GtkActionable</type></link> interface.</para>
<para>As with <link linkend="GtkApplication"><type>GtkApplication</type></link>, the GDK lock will be acquired when
processing actions arriving from other processes and should therefore
be held when activating actions locally (if GDK threads are enabled).</para>
<para>The settings <link linkend="GtkSettings--gtk-shell-shows-app-menu"><type>“gtk-shell-shows-app-menu”</type></link> and
<link linkend="GtkSettings--gtk-shell-shows-menubar"><type>“gtk-shell-shows-menubar”</type></link> tell GTK+ whether the
desktop environment is showing the application menu and menubar
models outside the application as part of the desktop shell.
For instance, on OS X, both menus will be displayed remotely;
on Windows neither will be. gnome-shell (starting with version 3.4)
will display the application menu, but not the menubar.</para>
<para>If the desktop environment does not display the menubar, then
<link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link> will automatically show a menubar for it.
This behaviour can be overridden with the <link linkend="GtkApplicationWindow--show-menubar"><type>“show-menubar”</type></link>
property. If the desktop environment does not display the application
menu, then it will automatically be included in the menubar or in the
windows client-side decorations.</para>
<para>See <link linkend="GtkPopoverMenu"><type>GtkPopoverMenu</type></link> for information about the XML language
used by <link linkend="GtkBuilder"><type>GtkBuilder</type></link> for menu models.</para>
<refsect3><title>A GtkApplicationWindow with a menubar</title><informalexample><programlisting role="example"><![CDATA[
GtkApplication *app = gtk_application_new ("org.gtk.test", 0);

GtkBuilder *builder = gtk_builder_new_from_string (
    "<interface>"
    "  <menu id='menubar'>"
    "    <submenu label='_Edit'>"
    "      <item label='_Copy' action='win.copy'/>"
    "      <item label='_Paste' action='win.paste'/>"
    "    </submenu>"
    "  </menu>"
    "</interface>",
    -1);

GMenuModel *menubar = G_MENU_MODEL (gtk_builder_get_object (builder,
                                                           "menubar"));
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
g_object_unref (builder);

// ...

GtkWidget *window = gtk_application_window_new (app);
]]></programlisting></informalexample>
<para></para>
</refsect3>

</refsect1>
<refsect1 id="GtkApplicationWindow.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-application-window-new" role="function">
<title>gtk_application_window_new&#160;()</title>
<indexterm zone="gtk-application-window-new"><primary>gtk_application_window_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_application_window_new (<parameter><link linkend="GtkApplication"><type>GtkApplication</type></link> *application</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link>.</para>
<refsect3 id="gtk-application-window-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>application</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkApplication"><type>GtkApplication</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-application-window-new.returns" role="returns">
<title>Returns</title>
<para> a newly created <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-application-window-set-show-menubar" role="function">
<title>gtk_application_window_set_show_menubar&#160;()</title>
<indexterm zone="gtk-application-window-set-show-menubar"><primary>gtk_application_window_set_show_menubar</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_application_window_set_show_menubar
                               (<parameter><link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link> *window</parameter>,
                                <parameter><link linkend="gboolean"><type>gboolean</type></link> show_menubar</parameter>);</programlisting>
<para>Sets whether the window will display a menubar for the app menu
and menubar as needed.</para>
<refsect3 id="gtk-application-window-set-show-menubar.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>window</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>show_menubar</para></entry>
<entry role="parameter_description"><para>whether to show a menubar when needed</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-application-window-get-show-menubar" role="function">
<title>gtk_application_window_get_show_menubar&#160;()</title>
<indexterm zone="gtk-application-window-get-show-menubar"><primary>gtk_application_window_get_show_menubar</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_application_window_get_show_menubar
                               (<parameter><link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link> *window</parameter>);</programlisting>
<para>Returns whether the window will display a menubar for the app menu
and menubar as needed.</para>
<refsect3 id="gtk-application-window-get-show-menubar.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>window</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-application-window-get-show-menubar.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>window</parameter>
will display a menubar when needed</para>
</refsect3></refsect2>
<refsect2 id="gtk-application-window-get-id" role="function">
<title>gtk_application_window_get_id&#160;()</title>
<indexterm zone="gtk-application-window-get-id"><primary>gtk_application_window_get_id</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gtk_application_window_get_id (<parameter><link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link> *window</parameter>);</programlisting>
<para>Returns the unique ID of the window. If the window has not yet been added to
a <link linkend="GtkApplication"><type>GtkApplication</type></link>, returns <literal>0</literal>.</para>
<refsect3 id="gtk-application-window-get-id.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>window</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-application-window-get-id.returns" role="returns">
<title>Returns</title>
<para> the unique ID for <parameter>window</parameter>
, or <literal>0</literal> if the window
has not yet been added to a <link linkend="GtkApplication"><type>GtkApplication</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-application-window-set-help-overlay" role="function">
<title>gtk_application_window_set_help_overlay&#160;()</title>
<indexterm zone="gtk-application-window-set-help-overlay"><primary>gtk_application_window_set_help_overlay</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_application_window_set_help_overlay
                               (<parameter><link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link> *window</parameter>,
                                <parameter><link linkend="GtkShortcutsWindow"><type>GtkShortcutsWindow</type></link> *help_overlay</parameter>);</programlisting>
<para>Associates a shortcuts window with the application window, and
sets up an action with the name win.show-help-overlay to present
it.</para>
<para><parameter>window</parameter>
 takes resposibility for destroying <parameter>help_overlay</parameter>
.</para>
<refsect3 id="gtk-application-window-set-help-overlay.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>window</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>help_overlay</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkShortcutsWindow"><type>GtkShortcutsWindow</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-application-window-get-help-overlay" role="function">
<title>gtk_application_window_get_help_overlay&#160;()</title>
<indexterm zone="gtk-application-window-get-help-overlay"><primary>gtk_application_window_get_help_overlay</primary></indexterm>
<programlisting language="C"><link linkend="GtkShortcutsWindow"><returnvalue>GtkShortcutsWindow</returnvalue></link>&#160;*
gtk_application_window_get_help_overlay
                               (<parameter><link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link> *window</parameter>);</programlisting>
<para>Gets the <link linkend="GtkShortcutsWindow"><type>GtkShortcutsWindow</type></link> that has been set up with
a prior call to <link linkend="gtk-application-window-set-help-overlay"><function>gtk_application_window_set_help_overlay()</function></link>.</para>
<refsect3 id="gtk-application-window-get-help-overlay.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>window</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkApplicationWindow"><type>GtkApplicationWindow</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-application-window-get-help-overlay.returns" role="returns">
<title>Returns</title>
<para>the help overlay associated with <parameter>window</parameter>
, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkApplicationWindow.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkApplicationWindow-struct" role="struct">
<title>struct GtkApplicationWindow</title>
<indexterm zone="GtkApplicationWindow-struct"><primary>GtkApplicationWindow</primary></indexterm>
<programlisting language="C">struct GtkApplicationWindow;</programlisting>
</refsect2>
<refsect2 id="GtkApplicationWindowClass" role="struct">
<title>struct GtkApplicationWindowClass</title>
<indexterm zone="GtkApplicationWindowClass"><primary>GtkApplicationWindowClass</primary></indexterm>
<programlisting language="C">struct GtkApplicationWindowClass {
  GtkWindowClass parent_class;
};
</programlisting>
<refsect3 id="GtkApplicationWindowClass.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>

</refsect1>
<refsect1 id="GtkApplicationWindow.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkApplicationWindow--show-menubar" role="property"><title>The <literal>“show-menubar”</literal> property</title>
<indexterm zone="GtkApplicationWindow--show-menubar"><primary>GtkApplicationWindow:show-menubar</primary></indexterm>
<programlisting>  “show-menubar”             <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>If this property is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, the window will display a menubar
that includes the app menu and menubar, unless these are
shown by the desktop shell. See <link linkend="gtk-application-set-app-menu"><function>gtk_application_set_app_menu()</function></link>
and <link linkend="gtk-application-set-menubar"><function>gtk_application_set_menubar()</function></link>.</para>
<para>If <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, the window will not display a menubar, regardless
of whether the desktop shell is showing the menus or not.</para>
<para>Owner: GtkApplicationWindow</para>
<para>Flags: Read / Write / Construct</para>
<para>Default value: FALSE</para>
</refsect2>

</refsect1>

</refentry>
