gtk3/docs/reference/gtk/html/GtkApplicationWindow.html
2017-12-21 20:47:04 -05:00

518 lines
32 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkApplicationWindow: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="Application.html" title="Application support">
<link rel="prev" href="GtkApplication.html" title="GtkApplication">
<link rel="next" href="GtkActionable.html" title="GtkActionable">
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#GtkApplicationWindow.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GtkApplicationWindow.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span> 
<a href="#GtkApplicationWindow.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties">  <span class="dim">|</span> 
<a href="#GtkApplicationWindow.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="Application.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkApplication.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkActionable.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GtkApplicationWindow"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkApplicationWindow.top_of_page"></a>GtkApplicationWindow</span></h2>
<p>GtkApplicationWindow — GtkWindow subclass with GtkApplication support</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GtkApplicationWindow.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkApplicationWindow.html#gtk-application-window-new" title="gtk_application_window_new ()">gtk_application_window_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkApplicationWindow.html#gtk-application-window-set-show-menubar" title="gtk_application_window_set_show_menubar ()">gtk_application_window_set_show_menubar</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GtkApplicationWindow.html#gtk-application-window-get-show-menubar" title="gtk_application_window_get_show_menubar ()">gtk_application_window_get_show_menubar</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="GtkApplicationWindow.html#gtk-application-window-get-id" title="gtk_application_window_get_id ()">gtk_application_window_get_id</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkApplicationWindow.html#gtk-application-window-set-help-overlay" title="gtk_application_window_set_help_overlay ()">gtk_application_window_set_help_overlay</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkShortcutsWindow.html" title="GtkShortcutsWindow"><span class="returnvalue">GtkShortcutsWindow</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkApplicationWindow.html#gtk-application-window-get-help-overlay" title="gtk_application_window_get_help_overlay ()">gtk_application_window_get_help_overlay</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody><tr>
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
<td class="property_name"><a class="link" href="GtkApplicationWindow.html#GtkApplicationWindow--show-menubar" title="The “show-menubar” property">show-menubar</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkApplicationWindow.html#GtkApplicationWindow-struct" title="struct GtkApplicationWindow">GtkApplicationWindow</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkApplicationWindow.html#GtkApplicationWindowClass" title="struct GtkApplicationWindowClass">GtkApplicationWindowClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="../gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
<span class="lineart">╰──</span> <a href="../gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
<span class="lineart">╰──</span> <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
<span class="lineart">╰──</span> <a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
<span class="lineart">╰──</span> <a class="link" href="GtkBin.html" title="GtkBin">GtkBin</a>
<span class="lineart">╰──</span> <a class="link" href="GtkWindow.html" title="GtkWindow">GtkWindow</a>
<span class="lineart">╰──</span> GtkApplicationWindow
</pre>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GtkApplicationWindow implements
AtkImplementorIface, <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>, <a href="../gio/GActionGroup.html#GActionGroup-struct">GActionGroup</a> and <a href="../gio/GActionMap.html#GActionMap-struct">GActionMap</a>.</p>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.description"></a><h2>Description</h2>
<p><a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> is a <a class="link" href="GtkWindow.html" title="GtkWindow"><span class="type">GtkWindow</span></a> subclass that offers some
extra functionality for better integration with <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a>
features. Notably, it can handle both the application menu as well
as the menubar. See <a class="link" href="GtkApplication.html#gtk-application-set-app-menu" title="gtk_application_set_app_menu ()"><code class="function">gtk_application_set_app_menu()</code></a> and
<a class="link" href="GtkApplication.html#gtk-application-set-menubar" title="gtk_application_set_menubar ()"><code class="function">gtk_application_set_menubar()</code></a>.</p>
<p>This class implements the <a href="../gio/GActionGroup.html#GActionGroup-struct"><span class="type">GActionGroup</span></a> and <a href="../gio/GActionMap.html#GActionMap-struct"><span class="type">GActionMap</span></a> interfaces,
to let you add window-specific actions that will be exported by the
associated <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a>, 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 <a href="../gio/GMenuModel.html#GMenuModel-struct"><span class="type">GMenuModel</span></a>.</p>
<p>Note that widgets that are placed inside a <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a>
can also activate these actions, if they implement the
<a class="link" href="GtkActionable.html" title="GtkActionable"><span class="type">GtkActionable</span></a> interface.</p>
<p>As with <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a>, 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).</p>
<p>The settings <a class="link" href="GtkSettings.html#GtkSettings--gtk-shell-shows-app-menu" title="The “gtk-shell-shows-app-menu” property"><span class="type">“gtk-shell-shows-app-menu”</span></a> and
<a class="link" href="GtkSettings.html#GtkSettings--gtk-shell-shows-menubar" title="The “gtk-shell-shows-menubar” property"><span class="type">“gtk-shell-shows-menubar”</span></a> 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.</p>
<p>If the desktop environment does not display the menubar, then
<a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> will automatically show a <a class="link" href="GtkMenuBar.html" title="GtkMenuBar"><span class="type">GtkMenuBar</span></a> for it.
This behaviour can be overridden with the <a class="link" href="GtkApplicationWindow.html#GtkApplicationWindow--show-menubar" title="The “show-menubar” property"><span class="type">“show-menubar”</span></a>
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.</p>
<div class="refsect3">
<a name="id-1.3.4.3.9.8"></a><h4>A GtkApplicationWindow with a menubar</h4>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21</pre></td>
<td class="listing_code"><pre class="programlisting">GtkApplication <span class="gtkdoc opt">*</span>app <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkApplication.html#gtk-application-new">gtk_application_new</a></span> <span class="gtkdoc opt">(</span><span class="string">&quot;org.gtk.test&quot;</span><span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">);</span>
GtkBuilder <span class="gtkdoc opt">*</span>builder <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkBuilder.html#gtk-builder-new-from-string">gtk_builder_new_from_string</a></span> <span class="gtkdoc opt">(</span>
<span class="string">&quot;&lt;interface&gt;&quot;</span>
<span class="string">&quot; &lt;menu id=&apos;menubar&apos;&gt;&quot;</span>
<span class="string">&quot; &lt;submenu label=&apos;_Edit&apos;&gt;&quot;</span>
<span class="string">&quot; &lt;item label=&apos;_Copy&apos; action=&apos;win.copy&apos;/&gt;&quot;</span>
<span class="string">&quot; &lt;item label=&apos;_Paste&apos; action=&apos;win.paste&apos;/&gt;&quot;</span>
<span class="string">&quot; &lt;/submenu&gt;&quot;</span>
<span class="string">&quot; &lt;/menu&gt;&quot;</span>
<span class="string">&quot;&lt;/interface&gt;&quot;</span><span class="gtkdoc opt">,</span>
<span class="gtkdoc opt">-</span><span class="number">1</span><span class="gtkdoc opt">);</span>
GMenuModel <span class="gtkdoc opt">*</span>menubar <span class="gtkdoc opt">=</span> <span class="function">G_MENU_MODEL</span> <span class="gtkdoc opt">(</span><span class="function"><a href="GtkBuilder.html#gtk-builder-get-object">gtk_builder_get_object</a></span> <span class="gtkdoc opt">(</span>builder<span class="gtkdoc opt">,</span>
<span class="string">&quot;menubar&quot;</span><span class="gtkdoc opt">));</span>
<span class="function"><a href="GtkApplication.html#gtk-application-set-menubar">gtk_application_set_menubar</a></span> <span class="gtkdoc opt">(</span><span class="function">GTK_APPLICATION</span> <span class="gtkdoc opt">(</span>app<span class="gtkdoc opt">),</span> menubar<span class="gtkdoc opt">);</span>
<span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="gtkdoc opt">(</span>builder<span class="gtkdoc opt">);</span>
<span class="gtkdoc slc">// ...</span>
GtkWidget <span class="gtkdoc opt">*</span>window <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkApplicationWindow.html#gtk-application-window-new">gtk_application_window_new</a></span> <span class="gtkdoc opt">(</span>app<span class="gtkdoc opt">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
</div>
<div class="refsect3">
<a name="id-1.3.4.3.9.9"></a><h4>Handling fallback yourself</h4>
<p><a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/sunny.c" target="_top">A simple example</a></p>
<p>The XML format understood by <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> for <a href="../gio/GMenuModel.html#GMenuModel-struct"><span class="type">GMenuModel</span></a> consists
of a toplevel <code class="literal">&lt;menu&gt;</code> element, which contains one or more <code class="literal">&lt;item&gt;</code>
elements. Each <code class="literal">&lt;item&gt;</code> element contains <code class="literal">&lt;attribute&gt;</code> and <code class="literal">&lt;link&gt;</code>
elements with a mandatory name attribute. <code class="literal">&lt;link&gt;</code> elements have the
same content model as <code class="literal">&lt;menu&gt;</code>. Instead of <code class="literal">&lt;link name="submenu&gt;</code> or
<code class="literal">&lt;link name="section"&gt;</code>, you can use <code class="literal">&lt;submenu&gt;</code> or <code class="literal">&lt;section&gt;</code>
elements.</p>
<p>Attribute values can be translated using gettext, like other <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
content. <code class="literal">&lt;attribute&gt;</code> elements can be marked for translation with a
<code class="literal">translatable="yes"</code> attribute. It is also possible to specify message
context and translator comments, using the context and comments attributes.
To make use of this, the <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> must have been given the gettext
domain to use.</p>
<p>The following attributes are used when constructing menu items:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>"label": a user-visible string to display</p></li>
<li class="listitem"><p>"action": the prefixed name of the action to trigger</p></li>
<li class="listitem"><p>"target": the parameter to use when activating the action</p></li>
<li class="listitem"><p>"icon" and "verb-icon": names of icons that may be displayed</p></li>
<li class="listitem"><p>"submenu-action": name of an action that may be used to determine
if a submenu can be opened</p></li>
<li class="listitem"><p>"hidden-when": a string used to determine when the item will be hidden.
Possible values include "action-disabled", "action-missing", "macos-menubar".</p></li>
</ul></div>
<p>The following attributes are used when constructing sections:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>"label": a user-visible string to use as section heading</p></li>
<li class="listitem"><p>"display-hint": a string used to determine special formatting for the section.
Possible values include "horizontal-buttons".</p></li>
<li class="listitem"><p>"text-direction": a string used to determine the <a class="link" href="GtkWidget.html#GtkTextDirection" title="enum GtkTextDirection"><span class="type">GtkTextDirection</span></a> to use
when "display-hint" is set to "horizontal-buttons". Possible values
include "rtl", "ltr", and "none".</p></li>
</ul></div>
<p>The following attributes are used when constructing submenus:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>"label": a user-visible string to display</p></li>
<li class="listitem"><p>"icon": icon name to display</p></li>
</ul></div>
</div>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-application-window-new"></a><h3>gtk_application_window_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_application_window_new (<em class="parameter"><code><a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a> *application</code></em>);</pre>
<p>Creates a new <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a>.</p>
<div class="refsect3">
<a name="gtk-application-window-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>application</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-application-window-new.returns"></a><h4>Returns</h4>
<p> a newly created <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-application-window-set-show-menubar"></a><h3>gtk_application_window_set_show_menubar ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_application_window_set_show_menubar
(<em class="parameter"><code><a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> *window</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> show_menubar</code></em>);</pre>
<p>Sets whether the window will display a menubar for the app menu
and menubar as needed.</p>
<div class="refsect3">
<a name="gtk-application-window-set-show-menubar.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>window</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>show_menubar</p></td>
<td class="parameter_description"><p>whether to show a menubar when needed</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-application-window-get-show-menubar"></a><h3>gtk_application_window_get_show_menubar ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_application_window_get_show_menubar
(<em class="parameter"><code><a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> *window</code></em>);</pre>
<p>Returns whether the window will display a menubar for the app menu
and menubar as needed.</p>
<div class="refsect3">
<a name="gtk-application-window-get-show-menubar.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>window</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-application-window-get-show-menubar.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>window</code></em>
will display a menubar when needed</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-application-window-get-id"></a><h3>gtk_application_window_get_id ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gtk_application_window_get_id (<em class="parameter"><code><a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> *window</code></em>);</pre>
<p>Returns the unique ID of the window. If the window has not yet been added to
a <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a>, returns <code class="literal">0</code>.</p>
<div class="refsect3">
<a name="gtk-application-window-get-id.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>window</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-application-window-get-id.returns"></a><h4>Returns</h4>
<p> the unique ID for <em class="parameter"><code>window</code></em>
, or <code class="literal">0</code> if the window
has not yet been added to a <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-6.html#api-index-3.6">3.6</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-application-window-set-help-overlay"></a><h3>gtk_application_window_set_help_overlay ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_application_window_set_help_overlay
(<em class="parameter"><code><a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> *window</code></em>,
<em class="parameter"><code><a class="link" href="GtkShortcutsWindow.html" title="GtkShortcutsWindow"><span class="type">GtkShortcutsWindow</span></a> *help_overlay</code></em>);</pre>
<p>Associates a shortcuts window with the application window, and
sets up an action with the name win.show-help-overlay to present
it.</p>
<p><em class="parameter"><code>window</code></em>
takes resposibility for destroying <em class="parameter"><code>help_overlay</code></em>
.</p>
<div class="refsect3">
<a name="gtk-application-window-set-help-overlay.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>window</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>help_overlay</p></td>
<td class="parameter_description"><p> a <a class="link" href="GtkShortcutsWindow.html" title="GtkShortcutsWindow"><span class="type">GtkShortcutsWindow</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-application-window-get-help-overlay"></a><h3>gtk_application_window_get_help_overlay ()</h3>
<pre class="programlisting"><a class="link" href="GtkShortcutsWindow.html" title="GtkShortcutsWindow"><span class="returnvalue">GtkShortcutsWindow</span></a> *
gtk_application_window_get_help_overlay
(<em class="parameter"><code><a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> *window</code></em>);</pre>
<p>Gets the <a class="link" href="GtkShortcutsWindow.html" title="GtkShortcutsWindow"><span class="type">GtkShortcutsWindow</span></a> that has been set up with
a prior call to <a class="link" href="GtkApplicationWindow.html#gtk-application-window-set-help-overlay" title="gtk_application_window_set_help_overlay ()"><code class="function">gtk_application_window_set_help_overlay()</code></a>.</p>
<div class="refsect3">
<a name="gtk-application-window-get-help-overlay.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>window</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-application-window-get-help-overlay.returns"></a><h4>Returns</h4>
<p> the help overlay associated with <em class="parameter"><code>window</code></em>
, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkApplicationWindow-struct"></a><h3>struct GtkApplicationWindow</h3>
<pre class="programlisting">struct GtkApplicationWindow;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkApplicationWindowClass"></a><h3>struct GtkApplicationWindowClass</h3>
<pre class="programlisting">struct GtkApplicationWindowClass {
GtkWindowClass parent_class;
};
</pre>
<div class="refsect3">
<a name="GtkApplicationWindowClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkApplicationWindow.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkApplicationWindow--show-menubar"></a><h3>The <code class="literal">“show-menubar”</code> property</h3>
<pre class="programlisting"> “show-menubar” <a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
<p>If this property is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the window will display a menubar
that includes the app menu and menubar, unless these are
shown by the desktop shell. See <a class="link" href="GtkApplication.html#gtk-application-set-app-menu" title="gtk_application_set_app_menu ()"><code class="function">gtk_application_set_app_menu()</code></a>
and <a class="link" href="GtkApplication.html#gtk-application-set-menubar" title="gtk_application_set_menubar ()"><code class="function">gtk_application_set_menubar()</code></a>.</p>
<p>If <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, the window will not display a menubar, regardless
of whether the desktop shell is showing the menus or not.</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: TRUE</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25.1</div>
</body>
</html>