This file is indexed.

/usr/share/doc/python-gtk2-tutorial/html/ch-ContainerWidgets.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
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 10. Container Widgets</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="index.html" title="PyGTK 2.0 Tutorial"><link rel="previous" href="sec-FontSelectionDialog.html" title="9.15. Font Selection Dialog"><link rel="next" href="sec-Alignment.html" title="10.2. The Alignment widget"></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 10. Container Widgets</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-FontSelectionDialog.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="sec-Alignment.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="ch-ContainerWidgets"></a>Chapter 10. Container Widgets</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch-ContainerWidgets.html#sec-EventBox">10.1. The EventBox</a></span></dt><dt><span class="sect1"><a href="sec-Alignment.html">10.2. The Alignment widget</a></span></dt><dt><span class="sect1"><a href="sec-Fixed.html">10.3. Fixed Container</a></span></dt><dt><span class="sect1"><a href="sec-Layout.html">10.4. Layout Container</a></span></dt><dt><span class="sect1"><a href="sec-Frames.html">10.5. Frames</a></span></dt><dt><span class="sect1"><a href="sec-AspectFrames.html">10.6. Aspect Frames</a></span></dt><dt><span class="sect1"><a href="sec-PanedWindowWidgets.html">10.7. Paned Window Widgets</a></span></dt><dt><span class="sect1"><a href="sec-Viewports.html">10.8. Viewports</a></span></dt><dt><span class="sect1"><a href="sec-ScrolledWindows.html">10.9. Scrolled Windows</a></span></dt><dt><span class="sect1"><a href="sec-ButtonBoxes.html">10.10. Button Boxes</a></span></dt><dt><span class="sect1"><a href="sec-Toolbar.html">10.11. Toolbar</a></span></dt><dt><span class="sect1"><a href="sec-Notebooks.html">10.12. Notebooks</a></span></dt><dt><span class="sect1"><a href="sec-PlugsAndSockets.html">10.13. Plugs and Sockets</a></span></dt><dd><dl><dt><span class="sect2"><a href="sec-PlugsAndSockets.html#id3114722">10.13.1. Plugs</a></span></dt><dt><span class="sect2"><a href="sec-PlugsAndSockets.html#id3114847">10.13.2. Sockets</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec-EventBox"></a>10.1. The EventBox</h2></div></div><div></div></div><p>Some GTK widgets don't have associated X windows, so they just
draw on their parents. Because of this, they cannot receive events and if
they are incorrectly sized, they don't clip so you can get messy
overwriting, etc. If you require more from these widgets, the
<tt class="classname">EventBox</tt> is for you.</p><p>At first glance, the <tt class="classname">EventBox</tt> widget
might appear to be totally useless. It draws nothing on the screen and
responds to no events. However, it does serve a function - it provides an X
window for its child widget. This is important as many GTK widgets do not
have an associated X window. Not having an X window saves memory and
improves performance, but also has some drawbacks. A widget without an X
window cannot receive events, does not perform any clipping on its contents
and cannot set its background color. Although the name
<tt class="classname">EventBox</tt> emphasizes the event-handling function, the
widget can also be used for clipping. (and more, see the example
below).</p><p>To create a new <tt class="classname">EventBox</tt> widget,
use:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  event_box = gtk.EventBox()
</pre></td></tr></table><p>A child widget can then be added to this
<i class="parameter"><tt>event_box</tt></i>:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  event_box.add(<b class="parameter"><tt>widget</tt></b>) 
</pre></td></tr></table><p>The <a href="examples/eventbox.py" target="_top"><span><b class="command">eventbox.py</b></span></a> example
program demonstrates both uses of an <tt class="classname">EventBox</tt> - a
label is created that is clipped to a small box, has a green background and
is set up so that a mouse-click on the label causes the program to exit.
Resizing the window reveals varying amounts of the label.
<a href="ch-ContainerWidgets.html#eventboxfig" title="Figure 10.1. Event Box Example">Figure 10.1, &#8220;Event Box Example&#8221;</a> illustrates the programs display:</p><div class="figure"><a name="eventboxfig"></a><p class="title"><b>Figure 10.1. Event Box Example</b></p><div class="mediaobject" align="center"><img src="figures/eventbox.png" align="middle" alt="Event Box Example"></div></div><p>The source code for <a href="examples/eventbox.py" target="_top"><span><b class="command">eventbox.py</b></span></a> is:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
    1	#!/usr/bin/env python
    2	
    3	# example eventbox.py
    4	
    5	import pygtk
    6	pygtk.require('2.0')
    7	import gtk
    8	
    9	class EventBoxExample:
   10	    def __init__(self):
   11	        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
   12	        window.set_title("Event Box")
   13	        window.connect("destroy", lambda w: gtk.main_quit())
   14	        window.set_border_width(10)
   15	
   16	        # Create an EventBox and add it to our toplevel window
   17	        event_box = gtk.EventBox()
   18	        window.add(event_box)
   19	        event_box.show()
   20	
   21	        # Create a long label
   22	        label = gtk.Label("Click here to quit, quit, quit, quit, quit")
   23	        event_box.add(label)
   24	        label.show()
   25	
   26	        # Clip it short.
   27	        label.set_size_request(110, 20)
   28	
   29	        # And bind an action to it
   30	        event_box.set_events(gtk.gdk.BUTTON_PRESS_MASK)
   31	        event_box.connect("button_press_event", lambda w,e: gtk.main_quit())
   32	
   33	        # More things you need an X window for ...
   34	        event_box.realize()
   35	        event_box.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.HAND1))
   36	
   37	        # Set background color to green
   38	        event_box.modify_bg(gtk.STATE_NORMAL,
   39	                            event_box.get_colormap().alloc_color("green"))
   40	
   41	        window.show()
   42	
   43	def main():
   44	    gtk.main()
   45	    return 0
   46	
   47	if __name__ == "__main__":
   48	    EventBoxExample()
   49	    main()
</pre></td></tr></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-FontSelectionDialog.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sec-Alignment.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9.15. Font Selection Dialog </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 10.2. The Alignment widget</td></tr></table></div></body></html>