This file is indexed.

/usr/share/doc/python-gtk2-tutorial/html/sec-Dialogs.html is in python-gtk2-tutorial 2.4-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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>9.5. Dialogs</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Tutorial"><link rel="up" href="ch-MiscellaneousWidgets.html" title="Chapter 9. Miscellaneous Widgets"><link rel="previous" href="sec-ProgressBars.html" title="9.4. Progress Bars"><link rel="next" href="sec-Images.html" title="9.6. Images"></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">9.5. Dialogs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-ProgressBars.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Miscellaneous Widgets</th><td width="20%" align="right"> <a accesskey="n" href="sec-Images.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec-Dialogs"></a>9.5. Dialogs</h2></div></div><div></div></div><p>The <tt class="classname">Dialog</tt> widget is very simple, and is
actually just a window with a few things pre-packed into it for you. It
simply creates a window, and then packs a <tt class="classname">VBox</tt> into
the top, which contains a separator and then an <tt class="classname">HBox</tt>
called the "action_area".</p><p>The <tt class="classname">Dialog</tt> widget can be used for pop-up
messages to the user, and other similar tasks. It is really basic, and there
is only one function for the dialog box, which is:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  dialog = gtk.Dialog(<b class="parameter"><tt>title</tt></b>=None, <b class="parameter"><tt>parent</tt></b>=None, <b class="parameter"><tt>flags</tt></b>=0, <b class="parameter"><tt>buttons</tt></b>=None)
</pre></td></tr></table><p>where <i class="parameter"><tt>title</tt></i> is the text to be used in the
titlebar, <i class="parameter"><tt>parent</tt></i> is the main application window and
<i class="parameter"><tt>flags</tt></i> set various modes of operation for the
dialog:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  DIALOG_MODAL - make the dialog modal
  DIALOG_DESTROY_WITH_PARENT - destroy dialog when its parent is destroyed
  DIALOG_NO_SEPARATOR - omit the separator between the vbox and the action_area  
</pre></td></tr></table><p>The <i class="parameter"><tt>buttons</tt></i> argument is a tuple of button
text and response pairs. All arguments have defaults and can be specified
using keywords.</p><p>This will create the dialog box, and it is now up to you to use
it. You could pack a button in the action_area:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  button = ...
  dialog.action_area.pack_start(button, TRUE, TRUE, 0)
  button.show()
</pre></td></tr></table><p>And you could add to the <i class="parameter"><tt>vbox</tt></i> area by
packing, for instance, a label in it, try something like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  label = gtk.Label("Dialogs are groovy")
  dialog.vbox.pack_start(label, TRUE, TRUE, 0)
  label.show()
</pre></td></tr></table><p>As an example in using the dialog box, you could put two buttons
in the <i class="parameter"><tt>action_area</tt></i>, a <span class="guibutton">Cancel</span>
button and an <span class="guibutton">Ok</span> button, and a label in the
<i class="parameter"><tt>vbox</tt></i> area, asking the user a question or giving an
error, etc. Then you could attach a different signal to each of the buttons
and perform the operation the user selects.</p><p>If the simple functionality provided by the default vertical and
horizontal boxes in the two areas doesn't give you enough control for your
application, then you can simply pack another layout widget into the boxes
provided. For example, you could pack a table into the vertical box.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-ProgressBars.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch-MiscellaneousWidgets.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sec-Images.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9.4. Progress Bars </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9.6. Images</td></tr></table></div></body></html>