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 public static GType getType() 75 { 76 return gtk_event_box_get_type(); 77 } 78 79 /** 80 * Creates a new #GtkEventBox. 81 * 82 * Return: a new #GtkEventBox 83 * 84 * Throws: ConstructionException GTK+ fails to create the object. 85 */ 86 public this() 87 { 88 auto p = gtk_event_box_new(); 89 90 if(p is null) 91 { 92 throw new ConstructionException("null returned by new"); 93 } 94 95 this(cast(GtkEventBox*) p); 96 } 97 98 /** 99 * Returns whether the event box window is above or below the 100 * windows of its child. See gtk_event_box_set_above_child() 101 * for details. 102 * 103 * Return: %TRUE if the event box window is above the 104 * window of its child 105 * 106 * Since: 2.4 107 */ 108 public bool getAboveChild() 109 { 110 return gtk_event_box_get_above_child(gtkEventBox) != 0; 111 } 112 113 /** 114 * Returns whether the event box has a visible window. 115 * See gtk_event_box_set_visible_window() for details. 116 * 117 * Return: %TRUE if the event box window is visible 118 * 119 * Since: 2.4 120 */ 121 public bool getVisibleWindow() 122 { 123 return gtk_event_box_get_visible_window(gtkEventBox) != 0; 124 } 125 126 /** 127 * Set whether the event box window is positioned above the windows 128 * of its child, as opposed to below it. If the window is above, all 129 * events inside the event box will go to the event box. If the window 130 * is below, events in windows of child widgets will first got to that 131 * widget, and then to its parents. 132 * 133 * The default is to keep the window below the child. 134 * 135 * Params: 136 * aboveChild = %TRUE if the event box window is above its child 137 * 138 * Since: 2.4 139 */ 140 public void setAboveChild(bool aboveChild) 141 { 142 gtk_event_box_set_above_child(gtkEventBox, aboveChild); 143 } 144 145 /** 146 * Set whether the event box uses a visible or invisible child 147 * window. The default is to use visible windows. 148 * 149 * In an invisible window event box, the window that the 150 * event box creates is a %GDK_INPUT_ONLY window, which 151 * means that it is invisible and only serves to receive 152 * events. 153 * 154 * A visible window event box creates a visible (%GDK_INPUT_OUTPUT) 155 * window that acts as the parent window for all the widgets 156 * contained in the event box. 157 * 158 * You should generally make your event box invisible if 159 * you just want to trap events. Creating a visible window 160 * may cause artifacts that are visible to the user, especially 161 * if the user is using a theme with gradients or pixmaps. 162 * 163 * The main reason to create a non input-only event box is if 164 * you want to set the background to a different color or 165 * draw on it. 166 * 167 * There is one unexpected issue for an invisible event box that has its 168 * window below the child. (See gtk_event_box_set_above_child().) 169 * Since the input-only window is not an ancestor window of any windows 170 * that descendent widgets of the event box create, events on these 171 * windows aren’t propagated up by the windowing system, but only by GTK+. 172 * The practical effect of this is if an event isn’t in the event 173 * mask for the descendant window (see gtk_widget_add_events()), 174 * it won’t be received by the event box. 175 * 176 * This problem doesn’t occur for visible event boxes, because in 177 * that case, the event box window is actually the ancestor of the 178 * descendant windows, not just at the same place on the screen. 179 * 180 * Params: 181 * visibleWindow = %TRUE to make the event box have a visible window 182 * 183 * Since: 2.4 184 */ 185 public void setVisibleWindow(bool visibleWindow) 186 { 187 gtk_event_box_set_visible_window(gtkEventBox, visibleWindow); 188 } 189 }