File: class-gtkruler.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (43 lines) | stat: -rw-r--r-- 12,782 bytes parent folder | download
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.Ruler</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtkrequisition.html" title="gtk.Requisition"><link rel="next" href="class-gtkscale.html" title="gtk.Scale"></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">gtk.Ruler</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkrequisition.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkscale.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkruler"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.Ruler</h2><p>gtk.Ruler &#8212; a base class for horizontal or vertical rulers</p></div><div class="refsect1" lang="en"><a name="id3493509"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Ruler</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a></span></span>):
<code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkruler.html#method-gtkruler--set-metric" title="gtk.Ruler.set_metric">set_metric</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>metric</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkruler.html#method-gtkruler--set-range" title="gtk.Ruler.set_range">set_range</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>lower</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>upper</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>max_size</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkruler.html#method-gtkruler--draw-ticks" title="gtk.Ruler.draw_ticks">draw_ticks</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkruler.html#method-gtkruler--draw-pos" title="gtk.Ruler.draw_pos">draw_pos</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkruler.html#method-gtkruler--get-metric" title="gtk.Ruler.get_metric">get_metric</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkruler.html#method-gtkruler--get-range" title="gtk.Ruler.get_range">get_range</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3493660"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
  +-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
    +-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
      +-- <a href="class-gtkruler.html" title="gtk.Ruler">gtk.Ruler</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3493696"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"lower"</td><td valign="top">Read-Write</td><td valign="top">the lower limit of the ruler</td></tr><tr valign="top"><td valign="top">"upper"</td><td valign="top">Read-Write</td><td valign="top">the upper limit of the ruler</td></tr><tr valign="top"><td valign="top">"position"</td><td valign="top">Read-Write</td><td valign="top">the position of the mark on the ruler</td></tr><tr valign="top"><td valign="top">"max-size"</td><td valign="top">Read-Write</td><td valign="top">the maximum size of the ruler</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3493819"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This widget is considered too specialized or little-used for
PyGTK and GTK+, and will in the future be moved to some other package. If
your application needs this widget, feel free to use it, as the widget does
work and is useful in some applications; it's just not of general interest.
However, it will eventually move out of the PyGTK and GTK+
distribution.</p></div><p>The <a href="class-gtkruler.html" title="gtk.Ruler"><tt class="classname">gtk.Ruler</tt></a> widget is a
base class for horizontal and vertical rulers. Rulers are used to show the
mouse pointer's location in a window. Within the ruler a small triangle
indicates the location of the mouse relative to the horizontal or vertical
ruler. See <a href="class-gtkhruler.html" title="gtk.HRuler"><tt class="classname">gtk.HRuler</tt></a> to learn
about horizontal rulers. See <a href="class-gtkvruler.html" title="gtk.VRuler"><tt class="classname">gtk.VRuler</tt></a> to learn
about vertical rulers.</p></div><div class="refsect1" lang="en"><a name="id3493870"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkruler--set-metric"></a><h3>gtk.Ruler.set_metric</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_metric</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>metric</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>metric</tt></b>:</span></td><td>the measurement units</td></tr></tbody></table><p>The <tt class="methodname">set_metric</tt>() method sets the
measurement units of the ruler to the value specified by
<i class="parameter"><tt>metric</tt></i>. Available units are
<tt class="literal">gtk.PIXELS</tt>, <tt class="literal">gtk.INCHES</tt>, or
<tt class="literal">gtk.CENTIMETERS</tt>. The default unit of measurement is
<tt class="literal">gtk.PIXELS</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtkruler--set-range"></a><h3>gtk.Ruler.set_range</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_range</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>lower</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>upper</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>max_size</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>lower</tt></b>:</span></td><td>the upper limit of the ruler</td></tr><tr><td><span class="term"><b class="parameter"><tt>upper</tt></b>:</span></td><td>the lower limit of the ruler</td></tr><tr><td><span class="term"><b class="parameter"><tt>position</tt></b>:</span></td><td>the position of the mark on the ruler</td></tr><tr><td><span class="term"><b class="parameter"><tt>max_size</tt></b>:</span></td><td>the maximum size of the rule</td></tr></tbody></table><p>The <tt class="methodname">set_range</tt>() method sets the range
of the ruler to the values specified by <i class="parameter"><tt>lower</tt></i>,
<i class="parameter"><tt>upper</tt></i>, <i class="parameter"><tt>position</tt></i> and
<i class="parameter"><tt>max_size</tt></i> (all values are floats).</p></div><div class="refsect2" lang="en"><a name="method-gtkruler--draw-ticks"></a><h3>gtk.Ruler.draw_ticks</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">draw_ticks</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">draw_ticks</tt>() method is overridden
by the <a href="class-gtkruler.html" title="gtk.Ruler"><tt class="classname">gtk.Ruler</tt></a> subclasses
(<a href="class-gtkhruler.html" title="gtk.HRuler"><tt class="classname">gtk.HRuler</tt></a>
and <a href="class-gtkvruler.html" title="gtk.VRuler"><tt class="classname">gtk.VRuler</tt></a>) to draw
the tick marks on the ruler. This method is not used by applications.</p></div><div class="refsect2" lang="en"><a name="method-gtkruler--draw-pos"></a><h3>gtk.Ruler.draw_pos</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">draw_pos</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">draw_pos</tt>() method is overridden by
the <a href="class-gtkruler.html" title="gtk.Ruler"><tt class="classname">gtk.Ruler</tt></a>
subclasses (<a href="class-gtkhruler.html" title="gtk.HRuler"><tt class="classname">gtk.HRuler</tt></a> and <a href="class-gtkvruler.html" title="gtk.VRuler"><tt class="classname">gtk.VRuler</tt></a>) to draw
the position mark on the ruler. This method is not used by
applications.</p></div><div class="refsect2" lang="en"><a name="method-gtkruler--get-metric"></a><h3>gtk.Ruler.get_metric</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_metric</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the measurement units currently used for the
ruler</td></tr></tbody></table><p>The <tt class="methodname">get_metric</tt>() method returns the
units used for a <a href="class-gtkruler.html" title="gtk.Ruler"><tt class="classname">gtk.Ruler</tt></a>. See the
<a href="class-gtkruler.html#method-gtkruler--set-metric" title="gtk.Ruler.set_metric"><tt class="methodname">set_metric</tt>()</a> 
method.</p></div><div class="refsect2" lang="en"><a name="method-gtkruler--get-range"></a><h3>gtk.Ruler.get_range</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_range</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&gt;:</span></td><td>a tuple containing: the lower limit of the
ruler, the upper limit of the ruler, the current position of the mark on the
ruler and the maximum size of the ruler used when calculating the space to
leave for the text.</td></tr></tbody></table><p>The <tt class="methodname">get_range</tt>() method returns a tuple
containing the values indicating the range and current position of a <a href="class-gtkruler.html" title="gtk.Ruler"><tt class="classname">gtk.Ruler</tt></a>. See the
<a href="class-gtkruler.html#method-gtkruler--set-range" title="gtk.Ruler.set_range"><tt class="methodname">set_range</tt>()</a> 
method.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkrequisition.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkscale.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Requisition</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Scale</td></tr></table></div></body></html>