This file is indexed.

/usr/share/doc/gtkmm-documentation/tutorial/html/chapter-menus-and-toolbars.html is in gtkmm-documentation 3.18.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 12. Menus and Toolbars</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Programming with gtkmm 3">
<link rel="up" href="index.html" title="Programming with gtkmm 3">
<link rel="prev" href="sec-textview-examples.html" title="Examples">
<link rel="next" href="sec-menubar-and-toolbar.html" title="Menubar and Toolbar">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Chapter 12. Menus and Toolbars</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="sec-textview-examples.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="sec-menubar-and-toolbar.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="chapter-menus-and-toolbars"></a>Chapter 12. Menus and Toolbars</h1></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<ul class="toc">
<li><span class="sect1"><a href="chapter-menus-and-toolbars.html#sec-actions">Actions</a></span></li>
<li><span class="sect1"><a href="sec-menubar-and-toolbar.html">Menubar and Toolbar</a></span></li>
<li><span class="sect1"><a href="sec-menus-popup.html">Popup Menus</a></span></li>
<li><span class="sect1"><a href="sec-gio-resource.html">Gio::Resource and glib-compile-resources</a></span></li>
<li><span class="sect1"><a href="sec-menus-examples.html">Examples</a></span></li>
</ul>
</div>
<p>
There are specific APIs for menus and toolbars, but you should usually deal
with them together, creating <code class="classname">Gio::SimpleAction</code>s that
you can refer to in both menus and toolbars. In this way you can handle
activation of the action instead of responding to the menu and toolbar items
separately. And you can enable or disable both the menu and toolbar item via
the action. <code class="classname">Gtk::Builder</code> can create menus and toolbars.
</p>
<p>
This involves the use of the <code class="classname">Gio::SimpleActionGroup</code>,
<code class="classname">Gio::SimpleAction</code> and <code class="classname">Gtk::Builder</code>
classes, all of which should be instantiated via their <code class="methodname">create()</code>
methods, which return <code class="classname">RefPtr</code>s.
</p>
<p>
Alternatively, <code class="classname">Gtk::ActionGroup</code>,
<code class="classname">Gtk::Action</code> and <code class="classname">Gtk::UIManager</code>
can be used, but this is not recommended in new code.
<code class="classname">GtkAction</code>, <code class="classname">GtkActionGroup</code> and
<code class="classname">GtkUIManager</code> are deprecated in GTK+ from version 3.10.
The corresponding classes in <span class="application">gtkmm</span> will be deprecated in the future.
</p>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="sec-actions"></a>Actions</h2></div></div></div>
<p>
First create the <code class="classname">Gio::SimpleAction</code>s and add them to a
<code class="classname">Gio::SimpleActionGroup</code>, with
<code class="methodname">Gio::ActionMap::add_action()</code>.
(<code class="classname">Gio::ActionMap</code> is a base class of
<code class="classname">Gio::SimpleActionGroup</code>.) Then add the action group to
your window with <code class="methodname">Gtk::Widget::insert_action_group()</code>.
</p>
<p>
The arguments to <code class="methodname">add_action()</code> specify the action's
name, which is used in the menu items and toolbar buttons. You can also specify
a signal handler when calling <code class="methodname">add_action()</code>. This signal
handler will be called when the action is activated via either a menu item or
a toolbar button.
</p>
<p>For instance:
</p>
<pre class="programlisting">
m_refActionGroup = Gio::SimpleActionGroup::create();

m_refActionGroup-&gt;add_action("new", sigc::mem_fun(*this, &amp;ExampleWindow::on_action_file_new));
m_refActionGroup-&gt;add_action("open", sigc::mem_fun(*this, &amp;ExampleWindow::on_action_file_open));
m_refActionGroup-&gt;add_action("quit", sigc::mem_fun(*this, &amp;ExampleWindow::on_action_file_quit));

insert_action_group("example", m_refActionGroup);
</pre>
<p>
If you use an <code class="classname">Gtk::ApplicationWindow</code>, you don't have to
create your own action group. <code class="classname">Gio::ActionGroup</code> and
<code class="classname">Gio::ActionMap</code> are base classes of
<code class="classname">Gtk::ApplicationWindow</code>.
</p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="sec-textview-examples.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="sec-menubar-and-toolbar.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Examples </td>
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="icons/home.png" alt="Home"></a></td>
<td width="40%" align="right" valign="top"> Menubar and Toolbar</td>
</tr>
</table>
</div>
</body>
</html>