<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gtkeventbox">
  <refnamediv>
    <refname>gtk.EventBox</refname>
    <refpurpose>a widget used to catch events for widgets which do not have
their own window.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.EventBox</classname></ooclass>
      <ooclass><classname><link
linkend="class-gtkbin">gtk.Bin</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gtkeventbox">gtk.EventBox</link></methodname>
	<methodparam></methodparam>  </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkeventbox--get-visible-window">get_visible_window</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkeventbox--set-visible-window">set_visible_window</link></methodname>
	<methodparam><parameter>visible_window</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkeventbox--get-above-child">get_above_child</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkeventbox--set-above-child">set_above_child</link></methodname>
	<methodparam><parameter>above_child</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkobject">gtk.Object</link>
    +-- <link linkend="class-gtkwidget">gtk.Widget</link>
      +-- <link linkend="class-gtkcontainer">gtk.Container</link>
        +-- <link linkend="class-gtkbin">gtk.Bin</link>
          +-- <link linkend="class-gtkeventbox">gtk.EventBox</link>
</synopsis>

  </refsect1>
  
  <refsect1>
		<title>Implemented Interfaces</title>
		<para>
			<link linkend="class-gtkeventbox"><classname>gtk.EventBox</classname></link>
			implements 
			<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
		</para>
	</refsect1>


  <refsect1 id="properties-gtkeventbox">
    <title>gtk.EventBox Properties</title>

    <para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
    <para><link linkend="properties-gtkwidget">gtk.Widget Properties</link></para>
    <para><link linkend="properties-gtkcontainer">gtk.Container Properties</link></para>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"above-child"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, 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.</entry>
	    </row>

	    <row valign="top">
	      <entry>"visible-window"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, the event box is visible,
	      as opposed to invisible and only used to trap
	      events. Available in GTK+ 2.4 and above.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="style-properties-gtkeventbox">
    <title>gtk.EventBox Style Properties</title>

    <para><link linkend="style-properties-gtkwidget">gtk.Widget Style Properties</link></para>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkeventbox">
    <title>gtk.EventBox Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkwidget">gtk.Widget Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkcontainer">gtk.Container Signal Prototypes</link></para>
</refsect1>

  <refsect1>
    <title>Description</title>

    <para>The <link
linkend="class-gtkeventbox"><classname>gtk.EventBox</classname></link>
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
<link linkend="class-gtkeventbox"><classname>gtk.EventBox</classname></link>
to receive event signals.</para>

  </refsect1>

  <refsect1 id="constructor-gtkeventbox">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.EventBox</methodname>
	<methodparam></methodparam>  </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>an eventbox widget</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-gtkeventbox"><classname>gtk.EventBox</classname></link>
widget.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtkeventbox--get-visible-window">
      <title>gtk.EventBox.get_visible_window</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_visible_window</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the event box window is
visible.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>gtk_visible_window</methodname>() method returns
<literal>True</literal> if the event box has a visible window. See the <link
linkend="method-gtkeventbox--set-visible-window"><methodname>set_visible_window()</methodname></link> method
for details.</para>

    </refsect2>

    <refsect2 id="method-gtkeventbox--set-visible-window">
      <title>gtk.EventBox.set_visible_window</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_visible_window</methodname>
	  <methodparam><parameter>visible_window</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>visible_window</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the event box window is
visible.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_visible_window</methodname>() method sets
whether the event box uses a visible or invisible child window according to
the value specified by <parameter>visible_window</parameter>. If
<parameter>visible_window</parameter> is <literal>True</literal> the event
box uses a visible child window; otherwise, an invisible child window. The
default is to use visible windows.</para>

      <para>In an invisible window event box, the window that that the event
box creates is a <literal>gtk.gdk.INPUT_ONLY</literal> window, that is
invisible and only serves to receive events. A visible window event box
creates a visible (<literal>gtk.gdk.INPUT_OUTPUT</literal>) window that acts
as the parent window for all the widgets contained in the event box.</para>

      <para>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.</para>

      <note>
	<para>There is one unexpected issue for an invisible event box that
has its window below the child. (See the <link
linkend="method-gtkeventbox--set-above-child"><methodname>set_above_child()</methodname></link>
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 <link
linkend="method-gtkwidget--add-events"><methodname>gtk.Widget.add_events()</methodname></link>
method), it won't be received by the event box.</para>

	<para> 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.</para>
      </note>

    </refsect2>

    <refsect2 id="method-gtkeventbox--get-above-child">
      <title>gtk.EventBox.get_above_child</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_above_child</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the event box window is
above the window of its child.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_above_child</methodname>() 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 <link
linkend="method-gtkeventbox--set-above-child"><methodname>set_above_child()</methodname></link>
method for details.</para>

    </refsect2>

    <refsect2 id="method-gtkeventbox--set-above-child">
      <title>gtk.EventBox.set_above_child</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_above_child</methodname>
	  <methodparam><parameter>above_child</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>above_child</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the event box window is
above the windows of its child</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_above_child</methodname>() method sets the
"above-child" property to the value of
<parameter>above_child</parameter>. If <parameter>above_child</parameter> is
<literal>True</literal>, 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.</para>

    </refsect2>

  </refsect1>

</refentry>
