<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkEventBox">
<refmeta>
<refentrytitle role="top_of_page" id="GtkEventBox.top_of_page">GtkEventBox</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkEventBox</refname>
<refpurpose>A widget used to catch events for widgets which do not have their own window</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkEventBox.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtk/gtk.h&gt;

                    <link linkend="GtkEventBox-struct">GtkEventBox</link>;
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-event-box-new">gtk_event_box_new</link>                   (void);
<link linkend="void">void</link>                <link linkend="gtk-event-box-set-above-child">gtk_event_box_set_above_child</link>       (<link linkend="GtkEventBox">GtkEventBox</link> *event_box,
                                                         <link linkend="gboolean">gboolean</link> above_child);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-event-box-get-above-child">gtk_event_box_get_above_child</link>       (<link linkend="GtkEventBox">GtkEventBox</link> *event_box);
<link linkend="void">void</link>                <link linkend="gtk-event-box-set-visible-window">gtk_event_box_set_visible_window</link>    (<link linkend="GtkEventBox">GtkEventBox</link> *event_box,
                                                         <link linkend="gboolean">gboolean</link> visible_window);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-event-box-get-visible-window">gtk_event_box_get_visible_window</link>    (<link linkend="GtkEventBox">GtkEventBox</link> *event_box);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkEventBox.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
         +----<link linkend="GtkObject">GtkObject</link>
               +----<link linkend="GtkWidget">GtkWidget</link>
                     +----<link linkend="GtkContainer">GtkContainer</link>
                           +----<link linkend="GtkBin">GtkBin</link>
                                 +----GtkEventBox
</synopsis>
</refsect1>



<refsect1 id="GtkEventBox.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkEventBox implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>
</refsect1>


<refsect1 id="GtkEventBox.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkEventBox--above-child">above-child</link>&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkEventBox--visible-window">visible-window</link>&quot;           <link linkend="gboolean">gboolean</link>              : Read / Write
</synopsis>
</refsect1>



<refsect1 id="GtkEventBox.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GtkEventBox"><type>GtkEventBox</type></link> widget is a subclass of <link linkend="GtkBin"><type>GtkBin</type></link> which also has its own window.
It is useful since it allows you to catch events for widgets which do not
have their own window.
</para>
</refsect1>

<refsect1 id="GtkEventBox.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkEventBox-struct" role="struct">
<title>GtkEventBox</title>
<indexterm zone="GtkEventBox-struct"><primary sortas="EventBox">GtkEventBox</primary></indexterm><programlisting>typedef struct _GtkEventBox GtkEventBox;</programlisting>
<para>
The <link linkend="GtkEventBox-struct"><type>GtkEventBox</type></link> struct contains private data only, and
should be accessed using the functions below.
</para></refsect2>
<refsect2 id="gtk-event-box-new" role="function">
<title>gtk_event_box_new ()</title>
<indexterm zone="gtk-event-box-new"><primary sortas="event_box_new">gtk_event_box_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_event_box_new                   (void);</programlisting>
<para>
Creates a new <link linkend="GtkEventBox"><type>GtkEventBox</type></link>.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a new <link linkend="GtkEventBox"><type>GtkEventBox</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-event-box-set-above-child" role="function" condition="since:2.4">
<title>gtk_event_box_set_above_child ()</title>
<indexterm zone="gtk-event-box-set-above-child" role="2.4"><primary sortas="event_box_set_above_child">gtk_event_box_set_above_child</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_event_box_set_above_child       (<link linkend="GtkEventBox">GtkEventBox</link> *event_box,
                                                         <link linkend="gboolean">gboolean</link> above_child);</programlisting>
<para>
Set whether the event box window is positioned above the windows of its child,
as opposed to 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.
</para>
<para>
The default is to keep the window below the child.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>event_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkEventBox"><type>GtkEventBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>above_child</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the event box window is above the windows of its child
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-event-box-get-above-child" role="function" condition="since:2.4">
<title>gtk_event_box_get_above_child ()</title>
<indexterm zone="gtk-event-box-get-above-child" role="2.4"><primary sortas="event_box_get_above_child">gtk_event_box_get_above_child</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_event_box_get_above_child       (<link linkend="GtkEventBox">GtkEventBox</link> *event_box);</programlisting>
<para>
Returns whether the event box window is above or below the
windows of its child. See <link linkend="gtk-event-box-set-above-child"><function>gtk_event_box_set_above_child()</function></link> for
details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>event_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkEventBox"><type>GtkEventBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the event box window is above the window
of its child.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-event-box-set-visible-window" role="function" condition="since:2.4">
<title>gtk_event_box_set_visible_window ()</title>
<indexterm zone="gtk-event-box-set-visible-window" role="2.4"><primary sortas="event_box_set_visible_window">gtk_event_box_set_visible_window</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_event_box_set_visible_window    (<link linkend="GtkEventBox">GtkEventBox</link> *event_box,
                                                         <link linkend="gboolean">gboolean</link> visible_window);</programlisting>
<para>
Set whether the event box uses a visible or invisible child
window. The default is to use visible windows.
</para>
<para>
In an invisible window event box, the window that the
event box creates is a <link linkend="GDK-INPUT-ONLY--CAPS"><literal>GDK_INPUT_ONLY</literal></link> window, which 
means that it is invisible and only serves to receive
events.
</para>
<para>
A visible window event box creates a visible (<link linkend="GDK-INPUT-OUTPUT--CAPS"><literal>GDK_INPUT_OUTPUT</literal></link>)
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.
</para>
<para>
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>
<para>
<note><para>
There is one unexpected issue for an invisible event box that has its
window below the child. (See <link linkend="gtk-event-box-set-above-child"><function>gtk_event_box_set_above_child()</function></link>.)
Since the input-only window is not an ancestor window of any windows
that descendent 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 <link linkend="gtk-widget-add-events"><function>gtk_widget_add_events()</function></link>),  
it won't be received by the event box. 
</para><para>
This problem doesn't occur for visible event boxes, because in
that case, the event box window is actually the ancestor of the
descendant windows, not just at the same place on the screen.
</para></note></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>event_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkEventBox"><type>GtkEventBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>visible_window</parameter>&#160;:</term>
<listitem><simpara> boolean value
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-event-box-get-visible-window" role="function" condition="since:2.4">
<title>gtk_event_box_get_visible_window ()</title>
<indexterm zone="gtk-event-box-get-visible-window" role="2.4"><primary sortas="event_box_get_visible_window">gtk_event_box_get_visible_window</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_event_box_get_visible_window    (<link linkend="GtkEventBox">GtkEventBox</link> *event_box);</programlisting>
<para>
Returns whether the event box has a visible window.
See <link linkend="gtk-event-box-set-visible-window"><function>gtk_event_box_set_visible_window()</function></link> for details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>event_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkEventBox"><type>GtkEventBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the event box window is visible

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>

</refsect1>
<refsect1 id="GtkEventBox.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkEventBox--above-child" role="property"><title>The <literal>&quot;above-child&quot;</literal> property</title>
<indexterm zone="GtkEventBox--above-child"><primary sortas="EventBox:above-child">GtkEventBox:above-child</primary></indexterm><programlisting>  &quot;above-child&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether the event-trapping window of the eventbox is above the window of the child widget as opposed to below it.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkEventBox--visible-window" role="property"><title>The <literal>&quot;visible-window&quot;</literal> property</title>
<indexterm zone="GtkEventBox--visible-window"><primary sortas="EventBox:visible-window">GtkEventBox:visible-window</primary></indexterm><programlisting>  &quot;visible-window&quot;           <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether the event box is visible, as opposed to invisible and only used to trap events.</para><para>Default value: TRUE</para>
</refsect2>
</refsect1>




</refentry>
