org.gnome.gtk
Class EventBox
Object
org.freedesktop.bindings.Pointer
org.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gtk.Object
org.gnome.gtk.Widget
org.gnome.gtk.Container
org.gnome.gtk.Bin
org.gnome.gtk.EventBox
public class EventBox
- extends Bin
Add the ability for a Widget to accept events. A fair number of Widgets do
not have the ability to process events coming from the user because,
under ordinary circumstances, they don't need it. If you want a Label or
Image to take keystrokes or mouse clicks, then you instantiate an EventBox
and pack your Widget into it.
Quite a number of Widgets share underlying resources. That's not something
you normally need to worry about as a developer, but if you have called
getWindow()
and find yourself needing an
underlying [org.gnome.gdk
] Window specifically for your
Widget, then use an EventBox.
EventBoxes can also be used for things like painting a different background
colour behind an otherwise transparent Widget.
- Since:
- 4.0.6
- Author:
- Andrew Cowie
Nested classes/interfaces inherited from class org.gnome.gtk.Widget |
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent |
Constructor Summary |
EventBox()
Create a new EventBox. |
Method Summary |
void |
setAboveChild(boolean setting)
Whether the EventBox should be "above" its child or not. |
void |
setVisibleWindow(boolean setting)
Whether the EventBox will have a "visible" child. |
Methods inherited from class org.gnome.gtk.Bin |
getChild |
Methods inherited from class org.gnome.gtk.Widget |
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getSensitive, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, realize, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll |
Methods inherited from class org.freedesktop.bindings.Pointer |
toString |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EventBox
public EventBox()
- Create a new EventBox. Be sure to call
setAboveChild()
and setVisibleWindow()
if necessary.
- Since:
- 4.0.6
setAboveChild
public void setAboveChild(boolean setting)
- Whether the EventBox should be "above" its child or not. If above, the
EventBox will receive all the events targeted at the child. If
below, then the events will first go to the child and then to the
EventBox. The default is
false
which is usually what you
want (ie, you don't want to mess with existing functionality in a
Widget, just add to it).
- Since:
- 4.0.6
setVisibleWindow
public void setVisibleWindow(boolean setting)
- Whether the EventBox will have a "visible" child. The default is
true
; ordinarily you want the child Widget to be displayed
normally.
- Since:
- 4.0.6