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
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.EventBox</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-gtkentrycompletion.html" title="gtk.EntryCompletion"><link rel="next" href="class-gtkexpander.html" title="gtk.Expander"></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.EventBox</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkentrycompletion.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkexpander.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkeventbox"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.EventBox</h2><p>gtk.EventBox — a widget used to catch events for widgets which do not have
their own window.</p></div><div class="refsect1" lang="en"><a name="id3410869"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.EventBox</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkeventbox.html#constructor-gtkeventbox" title="Constructor">gtk.EventBox</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkeventbox.html#method-gtkeventbox--get-visible-window" title="gtk.EventBox.get_visible_window">get_visible_window</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkeventbox.html#method-gtkeventbox--set-visible-window" title="gtk.EventBox.set_visible_window">set_visible_window</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>visible_window</tt></i></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkeventbox.html#method-gtkeventbox--get-above-child" title="gtk.EventBox.get_above_child">get_above_child</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkeventbox.html#method-gtkeventbox--set-above-child" title="gtk.EventBox.set_above_child">set_above_child</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>above_child</tt></i></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3410965"></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-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a href="class-gtkeventbox.html" title="gtk.EventBox">gtk.EventBox</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3411006"></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">"above-child"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, the event-trapping window
of the eventbox is above the window of the child widget as opposed to below
it. Available in GTK+ 2.4 and above.</td></tr><tr valign="top"><td valign="top">"visible-window"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, the event box is visible, as
opposed to invisible and only used to trap events. Available in GTK+ 2.4 and
above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3411092"></a><h2>Description</h2><p>The <a href="class-gtkeventbox.html" title="gtk.EventBox"><tt class="classname">gtk.EventBox</tt></a>
widget is an invisible container widget that provides a window for widgets
that do not have their own window. In GTK, widgets must have a window to be
able to receive event signals. Those widgets that are "windowless" can use a
<a href="class-gtkeventbox.html" title="gtk.EventBox"><tt class="classname">gtk.EventBox</tt></a>
to receive event signals.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkeventbox"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.EventBox</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>an eventbox widget</td></tr></tbody></table><p>Creates a new <a href="class-gtkeventbox.html" title="gtk.EventBox"><tt class="classname">gtk.EventBox</tt></a>
widget.</p></div><div class="refsect1" lang="en"><a name="id3411163"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkeventbox--get-visible-window"></a><h3>gtk.EventBox.get_visible_window</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_visible_window</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><tt class="literal">TRUE</tt> if the event box window is
visible.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">gtk_visible_window</tt>() method returns
<tt class="literal">TRUE</tt> if the event box has a visible window. See the <a href="class-gtkeventbox.html#method-gtkeventbox--set-visible-window" title="gtk.EventBox.set_visible_window"><tt class="methodname">set_visible_window()</tt></a> method
for details.</p></div><div class="refsect2" lang="en"><a name="method-gtkeventbox--set-visible-window"></a><h3>gtk.EventBox.set_visible_window</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible_window</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>visible_window</tt></i></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"><i class="parameter"><tt>visible_window</tt></i>:</span></td><td>if <tt class="literal">TRUE</tt> the event box window is
visible.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">set_visible_window</tt>() method sets
whether the event box uses a visible or invisible child window according to
the value specified by <i class="parameter"><tt>visible_window</tt></i>. If
<i class="parameter"><tt>visible_window</tt></i> is <tt class="literal">TRUE</tt> the event
box uses a visible child window; otherwise, an invisible child window. The
default is to use visible windows.</p><p>In an invisible window event box, the window that that the event
box creates is a <tt class="literal">gtk.gdk.INPUT_ONLY</tt> window, that is
invisible and only serves to receive events. A visible window event box
creates a visible (<tt class="literal">gtk.gdk.INPUT_OUTPUT</tt>) window that acts
as the parent window for all the widgets contained in the event box.</p><p>You should generally make your event box invisible if you just
want to trap events. Creating a visible window may cause artifacts that are
visible to the user, especially if the user is using a theme with gradients
or pixmaps. The main reason to create a non input-only event box is if you
want to set the background to a different color or draw on it.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>There is one unexpected issue for an invisible event box that
has its window below the child. (See the <a href="class-gtkeventbox.html#method-gtkeventbox--set-above-child" title="gtk.EventBox.set_above_child"><tt class="methodname">set_above_child()</tt></a>
method.) Since the input-only window is not an ancestor window of any
windows that descendant widgets of the event box create, events on these
windows aren't propagated up by the windowing system, but only by GTK+. The
practical effect of this is if an event isn't in the event mask for the
descendant window (see the <a href="class-gtkwidget.html#method-gtkwidget--add-events" title="gtk.Widget.add_events"><tt class="methodname">gtk.Widget.add_events()</tt></a>
method), it won't be received by the event box.</p><p> This problem doesn't occur for visible event boxes, because
the event box window is actually the ancestor of the descendant windows, not
just at the same place on the screen.</p></div></div><div class="refsect2" lang="en"><a name="method-gtkeventbox--get-above-child"></a><h3>gtk.EventBox.get_above_child</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_above_child</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><tt class="literal">TRUE</tt> if the event box window is
above the window of its child.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">get_above_child</tt>() method returns
the value of the "above-child" property that indicates whether the event box
window is above or below the windows of its child. See the <a href="class-gtkeventbox.html#method-gtkeventbox--set-above-child" title="gtk.EventBox.set_above_child"><tt class="methodname">set_above_child()</tt></a>
method for details.</p></div><div class="refsect2" lang="en"><a name="method-gtkeventbox--set-above-child"></a><h3>gtk.EventBox.set_above_child</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_above_child</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>above_child</tt></i></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"><i class="parameter"><tt>above_child</tt></i>:</span></td><td>if <tt class="literal">TRUE</tt> the event box window is
above the windows of its child</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">set_above_child</tt>() method sets the
"above-child" property to the value of
<i class="parameter"><tt>above_child</tt></i>. If <i class="parameter"><tt>above_child</tt></i> is
<tt class="literal">TRUE</tt>, the event box window is positioned above the
windows of its child; otherwise, below it. If the window is above, all
events inside the event box will go to the event box. If the window is
below, events in windows of child widgets will first got to that widget, and
then to its parents. The default is to keep the window below the child.</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-gtkentrycompletion.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-gtkexpander.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.EntryCompletion</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Expander</td></tr></table></div></body></html>
|