This file is indexed.

/usr/share/doc/python-gtk2-tutorial/html/sec-Statusbars.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>9.8. Statusbars</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-Rulers.html" title="9.7. Rulers"><link rel="next" href="sec-TextEntries.html" title="9.9. Text Entries"></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.8. Statusbars</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-Rulers.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Miscellaneous Widgets</th><td width="20%" align="right"> <a accesskey="n" href="sec-TextEntries.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-Statusbars"></a>9.8. Statusbars</h2></div></div><div></div></div><p><tt class="classname">Statusbars</tt> are simple widgets used to
display a text message. They keep a stack of the messages pushed onto them,
so that popping the current message will re-display the previous text
message.</p><p>In order to allow different parts of an application to use the
same statusbar to display messages, the statusbar widget issues Context
Identifiers which are used to identify different "users". The message on top
of the stack is the one displayed, no matter what context it is in. Messages
are stacked in last-in-first-out order, not context identifier order.</p><p>A statusbar is created with a call to:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  statusbar = gtk.Statusbar()
</pre></td></tr></table><p>A new Context Identifier is requested using a call to the following
method with a short textual description of the context:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  context_id = statusbar.get_context_id(<b class="parameter"><tt>context_description</tt></b>)
</pre></td></tr></table><p>There are three additional methods that operate on
statusbars:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  message_id = statusbar.push(<b class="parameter"><tt>context_id</tt></b>, <b class="parameter"><tt>text</tt></b>)

  statusbar.pop(<b class="parameter"><tt>context_id</tt></b>)

  statusbar.remove(<b class="parameter"><tt>context_id</tt></b>, <b class="parameter"><tt>message_id</tt></b>)
</pre></td></tr></table><p>The first, <tt class="methodname">push</tt>(), is used to add a new
message to the <i class="parameter"><tt>statusbar</tt></i>. It returns a
<i class="parameter"><tt>message_id</tt></i>, which can be passed later to the
<tt class="methodname">remove</tt>() method to remove the message with the
combination <i class="parameter"><tt>message_id</tt></i> and
<i class="parameter"><tt>context_id</tt></i> from the
<i class="parameter"><tt>statusbar</tt></i>'s stack.</p><p>The <tt class="methodname">pop</tt>() method removes the message
highest in the stack with the given
<i class="parameter"><tt>context_id</tt></i>.</p><p>The <a href="examples/statusbar.py" target="_top"><span><b class="command">statusbar.py</b></span></a> example
program creates a statusbar and two buttons, one for pushing items onto the
statusbar, and one for popping the last item back off.
<a href="sec-Statusbars.html#statusbarfig" title="Figure 9.9. Statusbar Example">Figure 9.9, &#8220;Statusbar Example&#8221;</a> illustrates the result:</p><div class="figure"><a name="statusbarfig"></a><p class="title"><b>Figure 9.9. Statusbar Example</b></p><div class="mediaobject" align="center"><img src="figures/statusbar.png" align="middle" alt="Statusbar Example"></div></div><p>The statusbar.py source code is:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
    1	#!/usr/bin/env python
    2	
    3	# example statusbar.py
    4	
    5	import pygtk
    6	pygtk.require('2.0')
    7	import gtk
    8	
    9	class StatusbarExample:
   10	    def push_item(self, widget, data):
   11	        buff = " Item %d" % self.count
   12	        self.count = self.count + 1
   13	        self.status_bar.push(data, buff)
   14	        return
   15	
   16	    def pop_item(self, widget, data):
   17	        self.status_bar.pop(data)
   18	        return
   19	
   20	    def __init__(self):
   21	        self.count = 1
   22	        # create a new window
   23	        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
   24	        window.set_size_request(200, 100)
   25	        window.set_title("PyGTK Statusbar Example")
   26	        window.connect("delete_event", lambda w,e: gtk.main_quit())
   27	 
   28	        vbox = gtk.VBox(False, 1)
   29	        window.add(vbox)
   30	        vbox.show()
   31	          
   32	        self.status_bar = gtk.Statusbar()      
   33	        vbox.pack_start(self.status_bar, True, True, 0)
   34	        self.status_bar.show()
   35	
   36	        context_id = self.status_bar.get_context_id("Statusbar example")
   37	
   38	        button = gtk.Button("push item")
   39	        button.connect("clicked", self.push_item, context_id)
   40	        vbox.pack_start(button, True, True, 2)
   41	        button.show()              
   42	
   43	        button = gtk.Button("pop last item")
   44	        button.connect("clicked", self.pop_item, context_id)
   45	        vbox.pack_start(button, True, True, 2)
   46	        button.show()              
   47	
   48	        # always display the window as the last step so it all splashes on
   49	        # the screen at once.
   50	        window.show()
   51	
   52	def main():
   53	    gtk.main()
   54	    return 0
   55	
   56	if __name__ == "__main__":
   57	    StatusbarExample()
   58	    main()
</pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-Rulers.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-TextEntries.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9.7. Rulers </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9.9. Text Entries</td></tr></table></div></body></html>