1 2@c %start of fragment 3 4@deftp Class <gtk-event-box> 5Derives from @code{<gtk-bin>}. 6 7This class defines the following slots: 8 9@table @code 10@item visible-window 11Whether the event box is visible, as opposed to invisible and only used to trap 12events. 13 14@item above-child 15Whether the event-trapping window of the eventbox is above the window of the 16child widget as opposed to below it. 17 18@end table 19 20@end deftp 21 22@deffn Function gtk-event-box-new @result{}@tie{} (ret@tie{}@code{<gtk-widget>}) 23Creates a new @code{<gtk-event-box>}. 24 25@table @var 26@item ret 27a new @code{<gtk-event-box>}. 28 29@end table 30 31@end deffn 32 33@deffn Function gtk-event-box-set-above-child (self@tie{}@code{<gtk-event-box>}) (above_child@tie{}@code{bool}) 34@deffnx Method set-above-child 35Set whether the event box window is positioned above the windows of its child, 36as opposed to below it. If the window is above, all events inside the event box 37will go to the event box. If the window is below, events in windows of child 38widgets will first got to that widget, and then to its parents. 39 40The default is to keep the window below the child. 41 42@table @var 43@item event-box 44a @code{<gtk-event-box>} 45 46@item above-child 47@samp{@code{#t}} if the event box window is above the windows of its child 48 49@end table 50 51Since 2.4 52 53@end deffn 54 55@deffn Function gtk-event-box-get-above-child (self@tie{}@code{<gtk-event-box>}) @result{}@tie{} (ret@tie{}@code{bool}) 56@deffnx Method get-above-child 57Returns whether the event box window is above or below the windows of its child. 58See @code{gtk-event-box-set-above-child} for details. 59 60@table @var 61@item event-box 62a @code{<gtk-event-box>} 63 64@item ret 65@samp{@code{#t}} if the event box window is above the window of its child. 66 67@end table 68 69Since 2.4 70 71@end deffn 72 73@deffn Function gtk-event-box-set-visible-window (self@tie{}@code{<gtk-event-box>}) (visible_window@tie{}@code{bool}) 74@deffnx Method set-visible-window 75Set whether the event box uses a visible or invisible child window. The default 76is to use visible windows. 77 78In an invisible window event box, the window that that the event box creates is 79a @samp{GDK_INPUT_ONLY} window, which means that it is invisible and only serves 80to receive events. 81 82A visible window event box creates a visible (@samp{GDK_INPUT_OUTPUT}) window 83that acts as the parent window for all the widgets contained in the event box. 84 85You should generally make your event box invisible if you just want to trap 86events. Creating a visible window may cause artifacts that are visible to the 87user, especially if the user is using a theme with gradients or pixmaps. 88 89The main reason to create a non input-only event box is if you want to set the 90background to a different color or draw on it. 91 92There is one unexpected issue for an invisible event box that has its window 93below the child. (See @code{gtk-event-box-set-above-child}.) Since the 94input-only window is not an ancestor window of any windows that descendent 95widgets of the event box create, events on these windows aren't propagated up by 96the windowing system, but only by GTK+. The practical effect of this is if an 97event isn't in the event mask for the descendant window (see 98@code{gtk-widget-add-events}), it won't be received by the event box. 99 100This problem doesn't occur for visible event boxes, because in that case, the 101event box window is actually the ancestor of the descendant windows, not just at 102the same place on the screen. 103 104@table @var 105@item event-box 106a @code{<gtk-event-box>} 107 108@item visible-window 109boolean value 110 111@end table 112 113Since 2.4 114 115@end deffn 116 117@deffn Function gtk-event-box-get-visible-window (self@tie{}@code{<gtk-event-box>}) @result{}@tie{} (ret@tie{}@code{bool}) 118@deffnx Method get-visible-window 119Returns whether the event box has a visible window. See 120@code{gtk-event-box-set-visible-window} for details. 121 122@table @var 123@item event-box 124a @code{<gtk-event-box>} 125 126@item ret 127@samp{@code{#t}} if the event box window is visible 128 129@end table 130 131Since 2.4 132 133@end deffn 134 135 136@c %end of fragment 137