1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>GtkUIManager</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
8
<link rel="up" href="Actions.html" title="Action-based menus and toolbars">
9
<link rel="prev" href="Actions.html" title="Action-based menus and toolbars">
10
<link rel="next" href="GtkActionGroup.html" title="GtkActionGroup">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="Actions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="Actions.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
21
<td><a accesskey="n" href="GtkActionGroup.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#GtkUIManager.synopsis" class="shortcut">Top</a>
26
<a href="#GtkUIManager.description" class="shortcut">Description</a>
28
<a href="#GtkUIManager.object-hierarchy" class="shortcut">Object Hierarchy</a>
30
<a href="#GtkUIManager.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
32
<a href="#GtkUIManager.properties" class="shortcut">Properties</a>
34
<a href="#GtkUIManager.signals" class="shortcut">Signals</a>
37
<div class="refentry">
38
<a name="GtkUIManager"></a><div class="titlepage"></div>
39
<div class="refnamediv"><table width="100%"><tr>
41
<h2><span class="refentrytitle"><a name="GtkUIManager.top_of_page"></a>GtkUIManager</span></h2>
42
<p>GtkUIManager — Constructing menus and toolbars from an XML description</p>
44
<td valign="top" align="right"></td>
46
<div class="refsynopsisdiv">
47
<a name="GtkUIManager.synopsis"></a><h2>Synopsis</h2>
48
<pre class="synopsis">
49
#include <gtk/gtk.h>
51
struct <a class="link" href="GtkUIManager.html#GtkUIManager-struct" title="struct GtkUIManager">GtkUIManager</a>;
52
<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="returnvalue">GtkUIManager</span></a> * <a class="link" href="GtkUIManager.html#gtk-ui-manager-new" title="gtk_ui_manager_new ()">gtk_ui_manager_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
53
<span class="returnvalue">void</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-set-add-tearoffs" title="gtk_ui_manager_set_add_tearoffs ()">gtk_ui_manager_set_add_tearoffs</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
54
<em class="parameter"><code><span class="type">gboolean</span> add_tearoffs</code></em>);
55
<span class="returnvalue">gboolean</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-add-tearoffs" title="gtk_ui_manager_get_add_tearoffs ()">gtk_ui_manager_get_add_tearoffs</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);
56
<span class="returnvalue">void</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-insert-action-group" title="gtk_ui_manager_insert_action_group ()">gtk_ui_manager_insert_action_group</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
57
<em class="parameter"><code><a class="link" href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>,
58
<em class="parameter"><code><span class="type">gint</span> pos</code></em>);
59
<span class="returnvalue">void</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-remove-action-group" title="gtk_ui_manager_remove_action_group ()">gtk_ui_manager_remove_action_group</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
60
<em class="parameter"><code><a class="link" href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>);
61
<span class="returnvalue">GList</span> * <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-action-groups" title="gtk_ui_manager_get_action_groups ()">gtk_ui_manager_get_action_groups</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);
62
<a class="link" href="gtk2-Keyboard-Accelerators.html#GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> * <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-accel-group" title="gtk_ui_manager_get_accel_group ()">gtk_ui_manager_get_accel_group</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);
63
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-widget" title="gtk_ui_manager_get_widget ()">gtk_ui_manager_get_widget</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
64
<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>);
65
<span class="returnvalue">GSList</span> * <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-toplevels" title="gtk_ui_manager_get_toplevels ()">gtk_ui_manager_get_toplevels</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
66
<em class="parameter"><code><a class="link" href="GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> types</code></em>);
67
<a class="link" href="GtkAction.html" title="GtkAction"><span class="returnvalue">GtkAction</span></a> * <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-action" title="gtk_ui_manager_get_action ()">gtk_ui_manager_get_action</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
68
<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>);
69
<span class="returnvalue">guint</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-add-ui-from-string" title="gtk_ui_manager_add_ui_from_string ()">gtk_ui_manager_add_ui_from_string</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
70
<em class="parameter"><code>const <span class="type">gchar</span> *buffer</code></em>,
71
<em class="parameter"><code><span class="type">gssize</span> length</code></em>,
72
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
73
#define <a class="link" href="GtkUIManager.html#gtk-ui-manager-add-ui-from-file" title="gtk_ui_manager_add_ui_from_file">gtk_ui_manager_add_ui_from_file</a>
74
<span class="returnvalue">guint</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-new-merge-id" title="gtk_ui_manager_new_merge_id ()">gtk_ui_manager_new_merge_id</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);
75
enum <a class="link" href="GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType">GtkUIManagerItemType</a>;
76
<span class="returnvalue">void</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-add-ui" title="gtk_ui_manager_add_ui ()">gtk_ui_manager_add_ui</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
77
<em class="parameter"><code><span class="type">guint</span> merge_id</code></em>,
78
<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>,
79
<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
80
<em class="parameter"><code>const <span class="type">gchar</span> *action</code></em>,
81
<em class="parameter"><code><a class="link" href="GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> type</code></em>,
82
<em class="parameter"><code><span class="type">gboolean</span> top</code></em>);
83
<span class="returnvalue">void</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-remove-ui" title="gtk_ui_manager_remove_ui ()">gtk_ui_manager_remove_ui</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
84
<em class="parameter"><code><span class="type">guint</span> merge_id</code></em>);
85
<span class="returnvalue">gchar</span> * <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-ui" title="gtk_ui_manager_get_ui ()">gtk_ui_manager_get_ui</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);
86
<span class="returnvalue">void</span> <a class="link" href="GtkUIManager.html#gtk-ui-manager-ensure-update" title="gtk_ui_manager_ensure_update ()">gtk_ui_manager_ensure_update</a> (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);
89
<div class="refsect1">
90
<a name="GtkUIManager.object-hierarchy"></a><h2>Object Hierarchy</h2>
91
<pre class="synopsis">
96
<div class="refsect1">
97
<a name="GtkUIManager.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
99
GtkUIManager implements
100
<a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>.</p>
102
<div class="refsect1">
103
<a name="GtkUIManager.properties"></a><h2>Properties</h2>
104
<pre class="synopsis">
105
"<a class="link" href="GtkUIManager.html#GtkUIManager--add-tearoffs" title='The "add-tearoffs" property'>add-tearoffs</a>" <span class="type">gboolean</span> : Read / Write
106
"<a class="link" href="GtkUIManager.html#GtkUIManager--ui" title='The "ui" property'>ui</a>" <span class="type">gchar</span>* : Read
109
<div class="refsect1">
110
<a name="GtkUIManager.signals"></a><h2>Signals</h2>
111
<pre class="synopsis">
112
"<a class="link" href="GtkUIManager.html#GtkUIManager-actions-changed" title='The "actions-changed" signal'>actions-changed</a>" : <code class="literal">No Recursion</code>
113
"<a class="link" href="GtkUIManager.html#GtkUIManager-add-widget" title='The "add-widget" signal'>add-widget</a>" : <code class="literal">No Recursion</code>
114
"<a class="link" href="GtkUIManager.html#GtkUIManager-connect-proxy" title='The "connect-proxy" signal'>connect-proxy</a>" : <code class="literal">No Recursion</code>
115
"<a class="link" href="GtkUIManager.html#GtkUIManager-disconnect-proxy" title='The "disconnect-proxy" signal'>disconnect-proxy</a>" : <code class="literal">No Recursion</code>
116
"<a class="link" href="GtkUIManager.html#GtkUIManager-post-activate" title='The "post-activate" signal'>post-activate</a>" : <code class="literal">No Recursion</code>
117
"<a class="link" href="GtkUIManager.html#GtkUIManager-pre-activate" title='The "pre-activate" signal'>pre-activate</a>" : <code class="literal">No Recursion</code>
120
<div class="refsect1">
121
<a name="GtkUIManager.description"></a><h2>Description</h2>
123
A <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> constructs a user interface (menus and toolbars) from
124
one or more UI definitions, which reference actions from one or more
127
<div class="refsect2">
128
<a name="XML-UI"></a><h3>UI Definitions</h3>
130
The UI definitions are specified in an XML format which can be
131
roughly described by the following DTD.
134
Do not confuse the GtkUIManager UI Definitions described here with
135
the similarly named <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder UI
140
<pre class="programlisting">
141
<!ELEMENT ui (menubar|toolbar|popup|accelerator)* >
142
<!ELEMENT menubar (menuitem|separator|placeholder|menu)* >
143
<!ELEMENT menu (menuitem|separator|placeholder|menu)* >
144
<!ELEMENT popup (menuitem|separator|placeholder|menu)* >
145
<!ELEMENT toolbar (toolitem|separator|placeholder)* >
146
<!ELEMENT placeholder (menuitem|toolitem|separator|placeholder|menu)* >
147
<!ELEMENT menuitem EMPTY >
148
<!ELEMENT toolitem (menu?) >
149
<!ELEMENT separator EMPTY >
150
<!ELEMENT accelerator EMPTY >
151
<!ATTLIST menubar name &num;IMPLIED
152
action &num;IMPLIED >
153
<!ATTLIST toolbar name &num;IMPLIED
154
action &num;IMPLIED >
155
<!ATTLIST popup name &num;IMPLIED
156
action &num;IMPLIED
157
accelerators (true|false) &num;IMPLIED >
158
<!ATTLIST placeholder name &num;IMPLIED
159
action &num;IMPLIED >
160
<!ATTLIST separator name &num;IMPLIED
161
action &num;IMPLIED
162
expand (true|false) &num;IMPLIED >
163
<!ATTLIST menu name &num;IMPLIED
164
action &num;REQUIRED
165
position (top|bot) &num;IMPLIED >
166
<!ATTLIST menuitem name &num;IMPLIED
167
action &num;REQUIRED
168
position (top|bot) &num;IMPLIED
169
always-show-image (true|false) &num;IMPLIED >
170
<!ATTLIST toolitem name &num;IMPLIED
171
action &num;REQUIRED
172
position (top|bot) &num;IMPLIED >
173
<!ATTLIST accelerator name &num;IMPLIED
174
action &num;REQUIRED >
177
There are some additional restrictions beyond those specified in the
178
DTD, e.g. every toolitem must have a toolbar in its anchestry and
179
every menuitem must have a menubar or popup in its anchestry. Since
180
a <span class="type">GMarkup</span> parser is used to parse the UI description, it must not only
181
be valid XML, but valid <span class="type">GMarkup</span>.
184
If a name is not specified, it defaults to the action. If an action is
185
not specified either, the element name is used. The name and action
186
attributes must not contain '/' characters after parsing (since that
187
would mess up path lookup) and must be usable as XML attributes when
188
enclosed in doublequotes, thus they must not '"' characters or references
189
to the &quot; entity.
191
<div class="example">
192
<a name="idp78428560"></a><p class="title"><b>Example 36. A UI definition</b></p>
193
<div class="example-contents">
194
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
197
<td class="listing_lines" align="right"><pre>1
221
<td class="listing_code"><pre class="programlisting"><span class="symbol"><</span><span class="normal">ui</span><span class="symbol">></span>
222
<span class="normal"> </span><span class="symbol"><</span><span class="normal">menubar</span><span class="symbol">></span>
223
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menu</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"FileMenu"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"FileMenuAction"</span><span class="symbol">></span>
224
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menuitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"New"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"New2Action"</span><span class="normal"> </span><span class="symbol">/></span>
225
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">placeholder</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"FileMenuAdditions"</span><span class="normal"> </span><span class="symbol">/></span>
226
<span class="normal"> </span><span class="symbol"></</span><span class="normal">menu</span><span class="symbol">></span>
227
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menu</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"JustifyMenu"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"JustifyMenuAction"</span><span class="symbol">></span>
228
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menuitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Left"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-left"</span><span class="symbol">/></span>
229
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menuitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Centre"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-center"</span><span class="symbol">/></span>
230
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menuitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Right"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-right"</span><span class="symbol">/></span>
231
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menuitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Fill"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-fill"</span><span class="symbol">/></span>
232
<span class="normal"> </span><span class="symbol"></</span><span class="normal">menu</span><span class="symbol">></span>
233
<span class="normal"> </span><span class="symbol"></</span><span class="normal">menubar</span><span class="symbol">></span>
234
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">toolbar</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"toolbar1"</span><span class="symbol">></span>
235
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">placeholder</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"JustifyToolItems"</span><span class="symbol">></span>
236
<span class="normal"> </span><span class="symbol"><</span><span class="normal">separator</span><span class="symbol">/></span>
237
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">toolitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Left"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-left"</span><span class="symbol">/></span>
238
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">toolitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Centre"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-center"</span><span class="symbol">/></span>
239
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">toolitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Right"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-right"</span><span class="symbol">/></span>
240
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">toolitem</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"Fill"</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"justify-fill"</span><span class="symbol">/></span>
241
<span class="normal"> </span><span class="symbol"><</span><span class="normal">separator</span><span class="symbol">/></span>
242
<span class="normal"> </span><span class="symbol"></</span><span class="normal">placeholder</span><span class="symbol">></span>
243
<span class="normal"> </span><span class="symbol"></</span><span class="normal">toolbar</span><span class="symbol">></span>
244
<span class="symbol"></</span><span class="normal">ui</span><span class="symbol">></span></pre></td>
251
<br class="example-break"><p>
252
The constructed widget hierarchy is very similar to the element tree
253
of the XML, with the exception that placeholders are merged into their
254
parents. The correspondence of XML elements to widgets should be
257
<div class="variablelist"><table border="0" class="variablelist">
259
<col align="left" valign="top">
264
<td><p><span class="term">menubar</span></p></td>
265
<td><p>a <a class="link" href="GtkMenuBar.html" title="GtkMenuBar"><span class="type">GtkMenuBar</span></a></p></td>
268
<td><p><span class="term">toolbar</span></p></td>
269
<td><p>a <a class="link" href="GtkToolbar.html" title="GtkToolbar"><span class="type">GtkToolbar</span></a></p></td>
272
<td><p><span class="term">popup</span></p></td>
273
<td><p>a toplevel <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
276
<td><p><span class="term">menu</span></p></td>
277
<td><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> attached to a menuitem</p></td>
280
<td><p><span class="term">menuitem</span></p></td>
281
<td><p>a <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> subclass, the exact type depends on the
285
<td><p><span class="term">toolitem</span></p></td>
286
<td><p>a <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> subclass, the exact type depends on the
287
action. Note that toolitem elements may contain a menu element, but only
288
if their associated action specifies a <a class="link" href="GtkMenuToolButton.html" title="GtkMenuToolButton"><span class="type">GtkMenuToolButton</span></a> as proxy.</p></td>
291
<td><p><span class="term">separator</span></p></td>
292
<td><p>a <a class="link" href="GtkSeparatorMenuItem.html" title="GtkSeparatorMenuItem"><span class="type">GtkSeparatorMenuItem</span></a> or
293
<a class="link" href="GtkSeparatorToolItem.html" title="GtkSeparatorToolItem"><span class="type">GtkSeparatorToolItem</span></a></p></td>
296
<td><p><span class="term">accelerator</span></p></td>
297
<td><p>a keyboard accelerator</p></td>
304
The "position" attribute determines where a constructed widget is positioned
305
wrt. to its siblings in the partially constructed tree. If it is
306
"top", the widget is prepended, otherwise it is appended.
310
<div class="refsect2">
311
<a name="UI-Merging"></a><h3>UI Merging</h3>
313
The most remarkable feature of <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> is that it can overlay a set
314
of menuitems and toolitems over another one, and demerge them later.
317
Merging is done based on the names of the XML elements. Each element is
318
identified by a path which consists of the names of its anchestors, separated
319
by slashes. For example, the menuitem named "Left" in the example above
320
has the path <code class="literal">/ui/menubar/JustifyMenu/Left</code> and the
321
toolitem with the same name has path
322
<code class="literal">/ui/toolbar1/JustifyToolItems/Left</code>.
326
<div class="refsect2">
327
<a name="idp78633984"></a><h3>Accelerators</h3>
329
Every action has an accelerator path. Accelerators are installed together with
330
menuitem proxies, but they can also be explicitly added with <accelerator>
331
elements in the UI definition. This makes it possible to have accelerators for
332
actions even if they have no visible proxies.
336
<div class="refsect2">
337
<a name="Smart-Separators"></a><h3>Smart Separators</h3>
339
The separators created by <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> are "smart", i.e. they do not show up
340
in the UI unless they end up between two visible menu or tool items. Separators
341
which are located at the very beginning or end of the menu or toolbar
342
containing them, or multiple separators next to each other, are hidden. This
343
is a useful feature, since the merging of UI elements from multiple sources
344
can make it hard or impossible to determine in advance whether a separator
345
will end up in such an unfortunate position.
348
For separators in toolbars, you can set <code class="literal">expand="true"</code> to
349
turn them from a small, visible separator to an expanding, invisible one.
350
Toolitems following an expanding separator are effectively right-aligned.
354
<div class="refsect2">
355
<a name="idp78639920"></a><h3>Empty Menus</h3>
357
Submenus pose similar problems to separators inconnection with merging. It is
358
impossible to know in advance whether they will end up empty after merging.
359
<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> offers two ways to treat empty submenus:
361
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
362
<li class="listitem"><p>make them disappear by hiding the menu item they're attached to
364
<li class="listitem"><p>add an insensitive "Empty" item
368
The behaviour is chosen based on the "hide_if_empty" property of the action
369
to which the submenu is associated.
373
<div class="refsect2">
374
<a name="GtkUIManager-BUILDER-UI"></a><h3>GtkUIManager as GtkBuildable</h3>
376
The GtkUIManager implementation of the GtkBuildable interface accepts
377
GtkActionGroup objects as <child> elements in UI definitions.
380
A GtkUIManager UI definition as described above can be embedded in
381
an GtkUIManager <object> element in a GtkBuilder UI definition.
384
The widgets that are constructed by a GtkUIManager can be embedded in
385
other parts of the constructed user interface with the help of the
386
"constructor" attribute. See the example below.
388
<div class="example">
389
<a name="idp78646704"></a><p class="title"><b>Example 37. An embedded GtkUIManager UI definition</b></p>
390
<div class="example-contents">
391
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
394
<td class="listing_lines" align="right"><pre>1
416
<td class="listing_code"><pre class="programlisting"><span class="symbol"><</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkUIManager"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"uiman"</span><span class="symbol">></span>
417
<span class="normal"> </span><span class="symbol"><</span><span class="normal">child</span><span class="symbol">></span>
418
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkActionGroup"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"actiongroup"</span><span class="symbol">></span>
419
<span class="normal"> </span><span class="symbol"><</span><span class="normal">child</span><span class="symbol">></span>
420
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkAction"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"file"</span><span class="symbol">></span>
421
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">property</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"label"</span><span class="symbol">></span><span class="normal">_File</span><span class="symbol"></</span><span class="normal">property</span><span class="symbol">></span>
422
<span class="normal"> </span><span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span>
423
<span class="normal"> </span><span class="symbol"></</span><span class="normal">child</span><span class="symbol">></span>
424
<span class="normal"> </span><span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span>
425
<span class="normal"> </span><span class="symbol"></</span><span class="normal">child</span><span class="symbol">></span>
426
<span class="normal"> </span><span class="symbol"><</span><span class="normal">ui</span><span class="symbol">></span>
427
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menubar</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"menubar1"</span><span class="symbol">></span>
428
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">menu</span><span class="normal"> action</span><span class="symbol">=</span><span class="string">"file"</span><span class="symbol">></span>
429
<span class="normal"> </span><span class="symbol"></</span><span class="normal">menu</span><span class="symbol">></span>
430
<span class="normal"> </span><span class="symbol"></</span><span class="normal">menubar</span><span class="symbol">></span>
431
<span class="normal"> </span><span class="symbol"></</span><span class="normal">ui</span><span class="symbol">></span>
432
<span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span>
433
<span class="symbol"><</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkWindow"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"main-window"</span><span class="symbol">></span>
434
<span class="normal"> </span><span class="symbol"><</span><span class="normal">child</span><span class="symbol">></span>
435
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkMenuBar"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"menubar1"</span><span class="normal"> constructor</span><span class="symbol">=</span><span class="string">"uiman"</span><span class="symbol">/></span>
436
<span class="normal"> </span><span class="symbol"></</span><span class="normal">child</span><span class="symbol">></span>
437
<span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span></pre></td>
444
<br class="example-break">
447
<div class="refsect1">
448
<a name="GtkUIManager.details"></a><h2>Details</h2>
449
<div class="refsect2">
450
<a name="GtkUIManager-struct"></a><h3>struct GtkUIManager</h3>
451
<pre class="programlisting">struct GtkUIManager;</pre>
453
The <span class="structname">GtkUIManager</span> struct contains only private
454
members and should not be accessed directly.
458
<div class="refsect2">
459
<a name="gtk-ui-manager-new"></a><h3>gtk_ui_manager_new ()</h3>
460
<pre class="programlisting"><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="returnvalue">GtkUIManager</span></a> * gtk_ui_manager_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
462
Creates a new ui manager object.
464
<div class="variablelist"><table border="0" class="variablelist">
466
<col align="left" valign="top">
470
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
471
<td>a new ui manager object.</td>
474
<p class="since">Since 2.4</p>
477
<div class="refsect2">
478
<a name="gtk-ui-manager-set-add-tearoffs"></a><h3>gtk_ui_manager_set_add_tearoffs ()</h3>
479
<pre class="programlisting"><span class="returnvalue">void</span> gtk_ui_manager_set_add_tearoffs (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
480
<em class="parameter"><code><span class="type">gboolean</span> add_tearoffs</code></em>);</pre>
482
Sets the "add_tearoffs" property, which controls whether menus
483
generated by this <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> will have tearoff menu items.
486
Note that this only affects regular menus. Generated popup
487
menus never have tearoff menu items.
489
<div class="variablelist"><table border="0" class="variablelist">
491
<col align="left" valign="top">
496
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
497
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
501
<td><p><span class="term"><em class="parameter"><code>add_tearoffs</code></em> :</span></p></td>
502
<td>whether tearoff menu items are added</td>
506
<p class="since">Since 2.4</p>
509
<div class="refsect2">
510
<a name="gtk-ui-manager-get-add-tearoffs"></a><h3>gtk_ui_manager_get_add_tearoffs ()</h3>
511
<pre class="programlisting"><span class="returnvalue">gboolean</span> gtk_ui_manager_get_add_tearoffs (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);</pre>
513
Returns whether menus generated by this <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
514
will have tearoff menu items.
516
<div class="variablelist"><table border="0" class="variablelist">
518
<col align="left" valign="top">
523
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
524
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
528
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
529
<td>whether tearoff menu items are added</td>
533
<p class="since">Since 2.4</p>
536
<div class="refsect2">
537
<a name="gtk-ui-manager-insert-action-group"></a><h3>gtk_ui_manager_insert_action_group ()</h3>
538
<pre class="programlisting"><span class="returnvalue">void</span> gtk_ui_manager_insert_action_group (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
539
<em class="parameter"><code><a class="link" href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>,
540
<em class="parameter"><code><span class="type">gint</span> pos</code></em>);</pre>
542
Inserts an action group into the list of action groups associated
543
with <em class="parameter"><code>self</code></em>. Actions in earlier groups hide actions with the same
544
name in later groups.
546
<div class="variablelist"><table border="0" class="variablelist">
548
<col align="left" valign="top">
553
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
554
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
557
<td><p><span class="term"><em class="parameter"><code>action_group</code></em> :</span></p></td>
558
<td>the action group to be inserted</td>
561
<td><p><span class="term"><em class="parameter"><code>pos</code></em> :</span></p></td>
562
<td>the position at which the group will be inserted.</td>
566
<p class="since">Since 2.4</p>
569
<div class="refsect2">
570
<a name="gtk-ui-manager-remove-action-group"></a><h3>gtk_ui_manager_remove_action_group ()</h3>
571
<pre class="programlisting"><span class="returnvalue">void</span> gtk_ui_manager_remove_action_group (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
572
<em class="parameter"><code><a class="link" href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>);</pre>
574
Removes an action group from the list of action groups associated
575
with <em class="parameter"><code>self</code></em>.
577
<div class="variablelist"><table border="0" class="variablelist">
579
<col align="left" valign="top">
584
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
585
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
588
<td><p><span class="term"><em class="parameter"><code>action_group</code></em> :</span></p></td>
589
<td>the action group to be removed</td>
593
<p class="since">Since 2.4</p>
596
<div class="refsect2">
597
<a name="gtk-ui-manager-get-action-groups"></a><h3>gtk_ui_manager_get_action_groups ()</h3>
598
<pre class="programlisting"><span class="returnvalue">GList</span> * gtk_ui_manager_get_action_groups (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);</pre>
600
Returns the list of action groups associated with <em class="parameter"><code>self</code></em>.
602
<div class="variablelist"><table border="0" class="variablelist">
604
<col align="left" valign="top">
609
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
610
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
613
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
614
<td>a <span class="type">GList</span> of
615
action groups. The list is owned by GTK+
616
and should not be modified. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkActionGroup][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
621
<p class="since">Since 2.4</p>
624
<div class="refsect2">
625
<a name="gtk-ui-manager-get-accel-group"></a><h3>gtk_ui_manager_get_accel_group ()</h3>
626
<pre class="programlisting"><a class="link" href="gtk2-Keyboard-Accelerators.html#GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> * gtk_ui_manager_get_accel_group (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);</pre>
628
Returns the <a class="link" href="gtk2-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> associated with <em class="parameter"><code>self</code></em>.
630
<div class="variablelist"><table border="0" class="variablelist">
632
<col align="left" valign="top">
637
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
638
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
641
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
642
<td>the <a class="link" href="gtk2-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
647
<p class="since">Since 2.4</p>
650
<div class="refsect2">
651
<a name="gtk-ui-manager-get-widget"></a><h3>gtk_ui_manager_get_widget ()</h3>
652
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_ui_manager_get_widget (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
653
<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>);</pre>
655
Looks up a widget by following a path.
656
The path consists of the names specified in the XML description of the UI.
657
separated by '/'. Elements which don't have a name or action attribute in
658
the XML (e.g. <popup>) can be addressed by their XML element name
659
(e.g. "popup"). The root element ("/ui") can be omitted in the path.
662
Note that the widget found by following a path that ends in a <menu>
663
element is the menuitem to which the menu is attached, not the menu itself.
666
Also note that the widgets constructed by a ui manager are not tied to
667
the lifecycle of the ui manager. If you add the widgets returned by this
668
function to some container or explicitly ref them, they will survive the
669
destruction of the ui manager.
671
<div class="variablelist"><table border="0" class="variablelist">
673
<col align="left" valign="top">
678
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
679
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
683
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
687
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
688
<td>the widget found by following the path, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if no widget
689
was found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
694
<p class="since">Since 2.4</p>
697
<div class="refsect2">
698
<a name="gtk-ui-manager-get-toplevels"></a><h3>gtk_ui_manager_get_toplevels ()</h3>
699
<pre class="programlisting"><span class="returnvalue">GSList</span> * gtk_ui_manager_get_toplevels (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
700
<em class="parameter"><code><a class="link" href="GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> types</code></em>);</pre>
702
Obtains a list of all toplevel widgets of the requested types.
704
<div class="variablelist"><table border="0" class="variablelist">
706
<col align="left" valign="top">
711
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
712
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
716
<td><p><span class="term"><em class="parameter"><code>types</code></em> :</span></p></td>
717
<td>specifies the types of toplevel widgets to include. Allowed
718
types are <a class="link" href="GtkUIManager.html#GTK-UI-MANAGER-MENUBAR:CAPS"><span class="type">GTK_UI_MANAGER_MENUBAR</span></a>, <a class="link" href="GtkUIManager.html#GTK-UI-MANAGER-TOOLBAR:CAPS"><span class="type">GTK_UI_MANAGER_TOOLBAR</span></a> and
719
<a class="link" href="GtkUIManager.html#GTK-UI-MANAGER-POPUP:CAPS"><span class="type">GTK_UI_MANAGER_POPUP</span></a>.</td>
722
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
723
<td>a newly-allocated <span class="type">GSList</span> of
724
all toplevel widgets of the requested types. Free the returned list with <code class="function">g_slist_free()</code>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkWidget][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span>
729
<p class="since">Since 2.4</p>
732
<div class="refsect2">
733
<a name="gtk-ui-manager-get-action"></a><h3>gtk_ui_manager_get_action ()</h3>
734
<pre class="programlisting"><a class="link" href="GtkAction.html" title="GtkAction"><span class="returnvalue">GtkAction</span></a> * gtk_ui_manager_get_action (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
735
<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>);</pre>
737
Looks up an action by following a path. See <a class="link" href="GtkUIManager.html#gtk-ui-manager-get-widget" title="gtk_ui_manager_get_widget ()"><code class="function">gtk_ui_manager_get_widget()</code></a>
738
for more information about paths.
740
<div class="variablelist"><table border="0" class="variablelist">
742
<col align="left" valign="top">
747
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
748
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
752
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
756
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
757
<td>the action whose proxy widget is found by following the path,
758
or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if no widget was found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
763
<p class="since">Since 2.4</p>
766
<div class="refsect2">
767
<a name="gtk-ui-manager-add-ui-from-string"></a><h3>gtk_ui_manager_add_ui_from_string ()</h3>
768
<pre class="programlisting"><span class="returnvalue">guint</span> gtk_ui_manager_add_ui_from_string (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
769
<em class="parameter"><code>const <span class="type">gchar</span> *buffer</code></em>,
770
<em class="parameter"><code><span class="type">gssize</span> length</code></em>,
771
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
773
Parses a string containing a <a class="link" href="GtkUIManager.html#XML-UI" title="UI Definitions">UI definition</a> and
774
merges it with the current contents of <em class="parameter"><code>self</code></em>. An enclosing <ui>
775
element is added if it is missing.
777
<div class="variablelist"><table border="0" class="variablelist">
779
<col align="left" valign="top">
784
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
785
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
788
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
789
<td>the string to parse</td>
792
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
793
<td>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)</td>
796
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
797
<td>return location for an error</td>
800
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
801
<td>The merge id for the merged UI. The merge id can be used
802
to unmerge the UI with <a class="link" href="GtkUIManager.html#gtk-ui-manager-remove-ui" title="gtk_ui_manager_remove_ui ()"><code class="function">gtk_ui_manager_remove_ui()</code></a>. If an error occurred,
803
the return value is 0.</td>
807
<p class="since">Since 2.4</p>
810
<div class="refsect2">
811
<a name="gtk-ui-manager-add-ui-from-file"></a><h3>gtk_ui_manager_add_ui_from_file</h3>
812
<pre class="programlisting">#define gtk_ui_manager_add_ui_from_file gtk_ui_manager_add_ui_from_file_utf8
815
Parses a file containing a <a class="link" href="GtkUIManager.html#XML-UI" title="UI Definitions">UI definition</a> and
816
merges it with the current contents of <em class="parameter"><code>self</code></em>.
818
<div class="variablelist"><table border="0" class="variablelist">
820
<col align="left" valign="top">
824
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
825
<td>The merge id for the merged UI. The merge id can be used
826
to unmerge the UI with <a class="link" href="GtkUIManager.html#gtk-ui-manager-remove-ui" title="gtk_ui_manager_remove_ui ()"><code class="function">gtk_ui_manager_remove_ui()</code></a>. If an error occurred,
827
the return value is 0.</td>
830
<p class="since">Since 2.4</p>
833
<div class="refsect2">
834
<a name="gtk-ui-manager-new-merge-id"></a><h3>gtk_ui_manager_new_merge_id ()</h3>
835
<pre class="programlisting"><span class="returnvalue">guint</span> gtk_ui_manager_new_merge_id (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);</pre>
837
Returns an unused merge id, suitable for use with
838
<a class="link" href="GtkUIManager.html#gtk-ui-manager-add-ui" title="gtk_ui_manager_add_ui ()"><code class="function">gtk_ui_manager_add_ui()</code></a>.
840
<div class="variablelist"><table border="0" class="variablelist">
842
<col align="left" valign="top">
847
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
848
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
852
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
853
<td>an unused merge id.</td>
857
<p class="since">Since 2.4</p>
860
<div class="refsect2">
861
<a name="GtkUIManagerItemType"></a><h3>enum GtkUIManagerItemType</h3>
862
<pre class="programlisting">typedef enum {
863
GTK_UI_MANAGER_AUTO = 0,
864
GTK_UI_MANAGER_MENUBAR = 1 << 0,
865
GTK_UI_MANAGER_MENU = 1 << 1,
866
GTK_UI_MANAGER_TOOLBAR = 1 << 2,
867
GTK_UI_MANAGER_PLACEHOLDER = 1 << 3,
868
GTK_UI_MANAGER_POPUP = 1 << 4,
869
GTK_UI_MANAGER_MENUITEM = 1 << 5,
870
GTK_UI_MANAGER_TOOLITEM = 1 << 6,
871
GTK_UI_MANAGER_SEPARATOR = 1 << 7,
872
GTK_UI_MANAGER_ACCELERATOR = 1 << 8,
873
GTK_UI_MANAGER_POPUP_WITH_ACCELS = 1 << 9
874
} GtkUIManagerItemType;
877
These enumeration values are used by <a class="link" href="GtkUIManager.html#gtk-ui-manager-add-ui" title="gtk_ui_manager_add_ui ()"><code class="function">gtk_ui_manager_add_ui()</code></a> to determine
878
what UI element to create.
880
<div class="variablelist"><table border="0" class="variablelist">
882
<col align="left" valign="top">
887
<td><p><a name="GTK-UI-MANAGER-AUTO:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_AUTO</code></span></p></td>
888
<td>Pick the type of the UI element according to context.
892
<td><p><a name="GTK-UI-MANAGER-MENUBAR:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_MENUBAR</code></span></p></td>
893
<td>Create a menubar.
897
<td><p><a name="GTK-UI-MANAGER-MENU:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_MENU</code></span></p></td>
902
<td><p><a name="GTK-UI-MANAGER-TOOLBAR:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_TOOLBAR</code></span></p></td>
903
<td>Create a toolbar.
907
<td><p><a name="GTK-UI-MANAGER-PLACEHOLDER:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_PLACEHOLDER</code></span></p></td>
908
<td>Insert a placeholder.
912
<td><p><a name="GTK-UI-MANAGER-POPUP:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_POPUP</code></span></p></td>
913
<td>Create a popup menu.
917
<td><p><a name="GTK-UI-MANAGER-MENUITEM:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_MENUITEM</code></span></p></td>
918
<td>Create a menuitem.
922
<td><p><a name="GTK-UI-MANAGER-TOOLITEM:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_TOOLITEM</code></span></p></td>
923
<td>Create a toolitem.
927
<td><p><a name="GTK-UI-MANAGER-SEPARATOR:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_SEPARATOR</code></span></p></td>
928
<td>Create a separator.
932
<td><p><a name="GTK-UI-MANAGER-ACCELERATOR:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_ACCELERATOR</code></span></p></td>
933
<td>Install an accelerator.
937
<td><p><a name="GTK-UI-MANAGER-POPUP-WITH-ACCELS:CAPS"></a><span class="term"><code class="literal">GTK_UI_MANAGER_POPUP_WITH_ACCELS</code></span></p></td>
938
<td>Same as <a class="link" href="GtkUIManager.html#GTK-UI-MANAGER-POPUP:CAPS"><code class="literal">GTK_UI_MANAGER_POPUP</code></a>, but the actions' accelerators are shown.
945
<div class="refsect2">
946
<a name="gtk-ui-manager-add-ui"></a><h3>gtk_ui_manager_add_ui ()</h3>
947
<pre class="programlisting"><span class="returnvalue">void</span> gtk_ui_manager_add_ui (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
948
<em class="parameter"><code><span class="type">guint</span> merge_id</code></em>,
949
<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>,
950
<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
951
<em class="parameter"><code>const <span class="type">gchar</span> *action</code></em>,
952
<em class="parameter"><code><a class="link" href="GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> type</code></em>,
953
<em class="parameter"><code><span class="type">gboolean</span> top</code></em>);</pre>
955
Adds a UI element to the current contents of <em class="parameter"><code>self</code></em>.
958
If <em class="parameter"><code>type</code></em> is <a class="link" href="GtkUIManager.html#GTK-UI-MANAGER-AUTO:CAPS"><code class="literal">GTK_UI_MANAGER_AUTO</code></a>, GTK+ inserts a menuitem, toolitem or
959
separator if such an element can be inserted at the place determined by
960
<em class="parameter"><code>path</code></em>. Otherwise <em class="parameter"><code>type</code></em> must indicate an element that can be inserted at
961
the place determined by <em class="parameter"><code>path</code></em>.
964
If <em class="parameter"><code>path</code></em> points to a menuitem or toolitem, the new element will be inserted
965
before or after this item, depending on <em class="parameter"><code>top</code></em>.
967
<div class="variablelist"><table border="0" class="variablelist">
969
<col align="left" valign="top">
974
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
975
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
979
<td><p><span class="term"><em class="parameter"><code>merge_id</code></em> :</span></p></td>
980
<td>the merge id for the merged UI, see <a class="link" href="GtkUIManager.html#gtk-ui-manager-new-merge-id" title="gtk_ui_manager_new_merge_id ()"><code class="function">gtk_ui_manager_new_merge_id()</code></a>
984
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
988
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
989
<td>the name for the added UI element</td>
992
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
993
<td>the name of the action to be proxied, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to add a separator. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
997
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
998
<td>the type of UI element to add.</td>
1001
<td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
1002
<td>if <code class="literal">TRUE</code>, the UI element is added before its siblings, otherwise it
1003
is added after its siblings.</td>
1007
<p class="since">Since 2.4</p>
1010
<div class="refsect2">
1011
<a name="gtk-ui-manager-remove-ui"></a><h3>gtk_ui_manager_remove_ui ()</h3>
1012
<pre class="programlisting"><span class="returnvalue">void</span> gtk_ui_manager_remove_ui (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>,
1013
<em class="parameter"><code><span class="type">guint</span> merge_id</code></em>);</pre>
1015
Unmerges the part of <em class="parameter"><code>self</code></em>s content identified by <em class="parameter"><code>merge_id</code></em>.
1017
<div class="variablelist"><table border="0" class="variablelist">
1019
<col align="left" valign="top">
1024
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
1025
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
1028
<td><p><span class="term"><em class="parameter"><code>merge_id</code></em> :</span></p></td>
1029
<td>a merge id as returned by <a class="link" href="GtkUIManager.html#gtk-ui-manager-add-ui-from-string" title="gtk_ui_manager_add_ui_from_string ()"><code class="function">gtk_ui_manager_add_ui_from_string()</code></a>
1034
<p class="since">Since 2.4</p>
1037
<div class="refsect2">
1038
<a name="gtk-ui-manager-get-ui"></a><h3>gtk_ui_manager_get_ui ()</h3>
1039
<pre class="programlisting"><span class="returnvalue">gchar</span> * gtk_ui_manager_get_ui (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);</pre>
1041
Creates a <a class="link" href="GtkUIManager.html#XML-UI" title="UI Definitions">UI definition</a> of the merged UI.
1043
<div class="variablelist"><table border="0" class="variablelist">
1045
<col align="left" valign="top">
1050
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
1051
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
1055
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1056
<td>A newly allocated string containing an XML representation of
1061
<p class="since">Since 2.4</p>
1064
<div class="refsect2">
1065
<a name="gtk-ui-manager-ensure-update"></a><h3>gtk_ui_manager_ensure_update ()</h3>
1066
<pre class="programlisting"><span class="returnvalue">void</span> gtk_ui_manager_ensure_update (<em class="parameter"><code><a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *self</code></em>);</pre>
1068
Makes sure that all pending updates to the UI have been completed.
1071
This may occasionally be necessary, since <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> updates the
1072
UI in an idle function. A typical example where this function is
1073
useful is to enforce that the menubar and toolbar have been added to
1074
the main window before showing it:
1076
<div class="informalexample">
1077
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
1080
<td class="listing_lines" align="right"><pre>1
1087
<td class="listing_code"><pre class="programlisting"><span class="function"><a href="GtkContainer.html#gtk-container-add">gtk_container_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">),</span><span class="normal"> vbox</span><span class="symbol">);</span><span class="normal"> </span>
1088
<span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">merge</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"add-widget"</span><span class="symbol">,</span><span class="normal"> </span>
1089
<span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">add_widget</span><span class="symbol">),</span><span class="normal"> vbox</span><span class="symbol">);</span>
1090
<span class="function"><a href="GtkUIManager.html#gtk-ui-manager-add-ui-from-file">gtk_ui_manager_add_ui_from_file</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">merge</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"my-menus"</span><span class="symbol">);</span>
1091
<span class="function"><a href="GtkUIManager.html#gtk-ui-manager-add-ui-from-file">gtk_ui_manager_add_ui_from_file</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">merge</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"my-toolbars"</span><span class="symbol">);</span>
1092
<span class="function"><a href="GtkUIManager.html#gtk-ui-manager-ensure-update">gtk_ui_manager_ensure_update</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">merge</span><span class="symbol">);</span><span class="normal"> </span>
1093
<span class="function"><a href="GtkWidget.html#gtk-widget-show">gtk_widget_show</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">);</span></pre></td>
1101
<div class="variablelist"><table border="0" class="variablelist">
1103
<col align="left" valign="top">
1107
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
1108
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
1112
<p class="since">Since 2.4</p>
1115
<div class="refsect1">
1116
<a name="GtkUIManager.property-details"></a><h2>Property Details</h2>
1117
<div class="refsect2">
1118
<a name="GtkUIManager--add-tearoffs"></a><h3>The <code class="literal">"add-tearoffs"</code> property</h3>
1119
<pre class="programlisting"> "add-tearoffs" <span class="type">gboolean</span> : Read / Write</pre>
1121
The "add-tearoffs" property controls whether generated menus
1122
have tearoff menu items.
1125
Note that this only affects regular menus. Generated popup
1126
menus never have tearoff menu items.
1128
<p>Default value: FALSE</p>
1129
<p class="since">Since 2.4</p>
1132
<div class="refsect2">
1133
<a name="GtkUIManager--ui"></a><h3>The <code class="literal">"ui"</code> property</h3>
1134
<pre class="programlisting"> "ui" <span class="type">gchar</span>* : Read</pre>
1135
<p>An XML string describing the merged UI.</p>
1136
<p>Default value: "<ui>\n</ui>\n"</p>
1139
<div class="refsect1">
1140
<a name="GtkUIManager.signal-details"></a><h2>Signal Details</h2>
1141
<div class="refsect2">
1142
<a name="GtkUIManager-actions-changed"></a><h3>The <code class="literal">"actions-changed"</code> signal</h3>
1143
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *merge,
1144
<span class="type">gpointer</span> user_data) : <code class="literal">No Recursion</code></pre>
1146
The "actions-changed" signal is emitted whenever the set of actions
1149
<div class="variablelist"><table border="0" class="variablelist">
1151
<col align="left" valign="top">
1156
<td><p><span class="term"><em class="parameter"><code>merge</code></em> :</span></p></td>
1157
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
1161
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1162
<td>user data set when the signal handler was connected.</td>
1166
<p class="since">Since 2.4</p>
1169
<div class="refsect2">
1170
<a name="GtkUIManager-add-widget"></a><h3>The <code class="literal">"add-widget"</code> signal</h3>
1171
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *merge,
1172
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget,
1173
<span class="type">gpointer</span> user_data) : <code class="literal">No Recursion</code></pre>
1175
The add_widget signal is emitted for each generated menubar and toolbar.
1176
It is not emitted for generated popup menus, which can be obtained by
1177
<a class="link" href="GtkUIManager.html#gtk-ui-manager-get-widget" title="gtk_ui_manager_get_widget ()"><code class="function">gtk_ui_manager_get_widget()</code></a>.
1179
<div class="variablelist"><table border="0" class="variablelist">
1181
<col align="left" valign="top">
1186
<td><p><span class="term"><em class="parameter"><code>merge</code></em> :</span></p></td>
1187
<td>a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>
1191
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
1192
<td>the added widget</td>
1195
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1196
<td>user data set when the signal handler was connected.</td>
1200
<p class="since">Since 2.4</p>
1203
<div class="refsect2">
1204
<a name="GtkUIManager-connect-proxy"></a><h3>The <code class="literal">"connect-proxy"</code> signal</h3>
1205
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *uimanager,
1206
<a class="link" href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a> *action,
1207
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *proxy,
1208
<span class="type">gpointer</span> user_data) : <code class="literal">No Recursion</code></pre>
1210
The connect_proxy signal is emitted after connecting a proxy to
1211
an action in the group.
1214
This is intended for simple customizations for which a custom action
1215
class would be too clumsy, e.g. showing tooltips for menuitems in the
1218
<div class="variablelist"><table border="0" class="variablelist">
1220
<col align="left" valign="top">
1225
<td><p><span class="term"><em class="parameter"><code>uimanager</code></em> :</span></p></td>
1226
<td>the ui manager</td>
1229
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
1233
<td><p><span class="term"><em class="parameter"><code>proxy</code></em> :</span></p></td>
1237
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1238
<td>user data set when the signal handler was connected.</td>
1242
<p class="since">Since 2.4</p>
1245
<div class="refsect2">
1246
<a name="GtkUIManager-disconnect-proxy"></a><h3>The <code class="literal">"disconnect-proxy"</code> signal</h3>
1247
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *uimanager,
1248
<a class="link" href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a> *action,
1249
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *proxy,
1250
<span class="type">gpointer</span> user_data) : <code class="literal">No Recursion</code></pre>
1252
The disconnect_proxy signal is emitted after disconnecting a proxy
1253
from an action in the group.
1255
<div class="variablelist"><table border="0" class="variablelist">
1257
<col align="left" valign="top">
1262
<td><p><span class="term"><em class="parameter"><code>uimanager</code></em> :</span></p></td>
1263
<td>the ui manager</td>
1266
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
1270
<td><p><span class="term"><em class="parameter"><code>proxy</code></em> :</span></p></td>
1274
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1275
<td>user data set when the signal handler was connected.</td>
1279
<p class="since">Since 2.4</p>
1282
<div class="refsect2">
1283
<a name="GtkUIManager-post-activate"></a><h3>The <code class="literal">"post-activate"</code> signal</h3>
1284
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *uimanager,
1285
<a class="link" href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a> *action,
1286
<span class="type">gpointer</span> user_data) : <code class="literal">No Recursion</code></pre>
1288
The post_activate signal is emitted just after the <em class="parameter"><code>action</code></em>
1292
This is intended for applications to get notification
1293
just after any action is activated.
1295
<div class="variablelist"><table border="0" class="variablelist">
1297
<col align="left" valign="top">
1302
<td><p><span class="term"><em class="parameter"><code>uimanager</code></em> :</span></p></td>
1303
<td>the ui manager</td>
1306
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
1310
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1311
<td>user data set when the signal handler was connected.</td>
1315
<p class="since">Since 2.4</p>
1318
<div class="refsect2">
1319
<a name="GtkUIManager-pre-activate"></a><h3>The <code class="literal">"pre-activate"</code> signal</h3>
1320
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> *uimanager,
1321
<a class="link" href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a> *action,
1322
<span class="type">gpointer</span> user_data) : <code class="literal">No Recursion</code></pre>
1324
The pre_activate signal is emitted just before the <em class="parameter"><code>action</code></em>
1328
This is intended for applications to get notification
1329
just before any action is activated.
1331
<div class="variablelist"><table border="0" class="variablelist">
1333
<col align="left" valign="top">
1338
<td><p><span class="term"><em class="parameter"><code>uimanager</code></em> :</span></p></td>
1339
<td>the ui manager</td>
1342
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
1346
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1347
<td>user data set when the signal handler was connected.</td>
1351
<p class="since">Since 2.4</p>
1354
<div class="refsect1">
1355
<a name="GtkUIManager.see-also"></a><h2>See Also</h2>
1357
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
1361
<div class="footer">
1363
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'