1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gtk.EventBox; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gtk.Bin; 30 private import gtk.Widget; 31 private import gtkc.gtk; 32 public import gtkc.gtktypes; 33 34 35 /** 36 * The #GtkEventBox widget is a subclass of #GtkBin which also has its 37 * own window. It is useful since it allows you to catch events for widgets 38 * which do not have their own window. 39 */ 40 public class EventBox : Bin 41 { 42 /** the main Gtk struct */ 43 protected GtkEventBox* gtkEventBox; 44 45 /** Get the main Gtk struct */ 46 public GtkEventBox* getEventBoxStruct() 47 { 48 return gtkEventBox; 49 } 50 51 /** the main Gtk struct as a void* */ 52 protected override void* getStruct() 53 { 54 return cast(void*)gtkEventBox; 55 } 56 57 protected override void setStruct(GObject* obj) 58 { 59 gtkEventBox = cast(GtkEventBox*)obj; 60 super.setStruct(obj); 61 } 62 63 /** 64 * Sets our main struct and passes it to the parent class. 65 */ 66 public this (GtkEventBox* gtkEventBox, bool ownedRef = false) 67 { 68 this.gtkEventBox = gtkEventBox; 69 super(cast(GtkBin*)gtkEventBox, ownedRef); 70 } 71 72 /** 73 */ 74 75 public static GType getType() 76 { 77 return gtk_event_box_get_type(); 78 } 79 80 /** 81 * Creates a new #GtkEventBox. 82 * 83 * Return: a new #GtkEventBox 84 * 85 * Throws: ConstructionException GTK+ fails to create the object. 86 */ 87 public this() 88 { 89 auto p = gtk_event_box_new(); 90 91 if(p is null) 92 { 93 throw new ConstructionException("null returned by new"); 94 } 95 96 this(cast(GtkEventBox*) p); 97 } 98 99 /** 100 * Returns whether the event box window is above or below the 101 * windows of its child. See gtk_event_box_set_above_child() 102 * for details. 103 * 104 * Return: %TRUE if the event box window is above the 105 * window of its child 106 * 107 * Since: 2.4 108 */ 109 public bool getAboveChild() 110 { 111 return gtk_event_box_get_above_child(gtkEventBox) != 0; 112 } 113 114 /** 115 * Returns whether the event box has a visible window. 116 * See gtk_event_box_set_visible_window() for details. 117 * 118 * Return: %TRUE if the event box window is visible 119 * 120 * Since: 2.4 121 */ 122 public bool getVisibleWindow() 123 { 124 return gtk_event_box_get_visible_window(gtkEventBox) != 0; 125 } 126 127 /** 128 * Set whether the event box window is positioned above the windows 129 * of its child, as opposed to below it. If the window is above, all 130 * events inside the event box will go to the event box. If the window 131 * is below, events in windows of child widgets will first got to that 132 * widget, and then to its parents. 133 * 134 * The default is to keep the window below the child. 135 * 136 * Params: 137 * aboveChild = %TRUE if the event box window is above its child 138 * 139 * Since: 2.4 140 */ 141 public void setAboveChild(bool aboveChild) 142 { 143 gtk_event_box_set_above_child(gtkEventBox, aboveChild); 144 } 145 146 /** 147 * Set whether the event box uses a visible or invisible child 148 * window. The default is to use visible windows. 149 * 150 * In an invisible window event box, the window that the 151 * event box creates is a %GDK_INPUT_ONLY window, which 152 * means that it is invisible and only serves to receive 153 * events. 154 * 155 * A visible window event box creates a visible (%GDK_INPUT_OUTPUT) 156 * window that acts as the parent window for all the widgets 157 * contained in the event box. 158 * 159 * You should generally make your event box invisible if 160 * you just want to trap events. Creating a visible window 161 * may cause artifacts that are visible to the user, especially 162 * if the user is using a theme with gradients or pixmaps. 163 * 164 * The main reason to create a non input-only event box is if 165 * you want to set the background to a different color or 166 * draw on it. 167 * 168 * There is one unexpected issue for an invisible event box that has its 169 * window below the child. (See gtk_event_box_set_above_child().) 170 * Since the input-only window is not an ancestor window of any windows 171 * that descendent widgets of the event box create, events on these 172 * windows aren’t propagated up by the windowing system, but only by GTK+. 173 * The practical effect of this is if an event isn’t in the event 174 * mask for the descendant window (see gtk_widget_add_events()), 175 * it won’t be received by the event box. 176 * 177 * This problem doesn’t occur for visible event boxes, because in 178 * that case, the event box window is actually the ancestor of the 179 * descendant windows, not just at the same place on the screen. 180 * 181 * Params: 182 * visibleWindow = %TRUE to make the event box have a visible window 183 * 184 * Since: 2.4 185 */ 186 public void setVisibleWindow(bool visibleWindow) 187 { 188 gtk_event_box_set_visible_window(gtkEventBox, visibleWindow); 189 } 190 }