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 * Conversion parameters: 26 * inFile = GtkBin.html 27 * outPack = gtk 28 * outFile = Bin 29 * strct = GtkBin 30 * realStrct= 31 * ctorStrct= 32 * clss = Bin 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_bin_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gtk.Widget 47 * structWrap: 48 * - GtkWidget* -> Widget 49 * module aliases: 50 * local aliases: 51 * overrides: 52 */ 53 54 module gtk.Bin; 55 56 public import gtkc.gtktypes; 57 58 private import gtkc.gtk; 59 private import glib.ConstructionException; 60 private import gobject.ObjectG; 61 62 63 private import gtk.Widget; 64 65 66 67 private import gtk.Container; 68 69 /** 70 * The GtkBin widget is a container with just one child. 71 * It is not very useful itself, but it is useful for deriving subclasses, 72 * since it provides common code needed for handling a single child widget. 73 * 74 * Many GTK+ widgets are subclasses of GtkBin, including GtkWindow, 75 * GtkButton, GtkFrame, GtkHandleBox or GtkScrolledWindow. 76 */ 77 public class Bin : Container 78 { 79 80 /** the main Gtk struct */ 81 protected GtkBin* gtkBin; 82 83 84 public GtkBin* getBinStruct() 85 { 86 return gtkBin; 87 } 88 89 90 /** the main Gtk struct as a void* */ 91 protected override void* getStruct() 92 { 93 return cast(void*)gtkBin; 94 } 95 96 /** 97 * Sets our main struct and passes it to the parent class 98 */ 99 public this (GtkBin* gtkBin) 100 { 101 super(cast(GtkContainer*)gtkBin); 102 this.gtkBin = gtkBin; 103 } 104 105 protected override void setStruct(GObject* obj) 106 { 107 super.setStruct(obj); 108 gtkBin = cast(GtkBin*)obj; 109 } 110 111 /** 112 */ 113 114 /** 115 * Gets the child of the GtkBin, or NULL if the bin contains 116 * no child widget. The returned widget does not have a reference 117 * added, so you do not need to unref it. 118 * Returns: pointer to child of the GtkBin. [transfer none] 119 */ 120 public Widget getChild() 121 { 122 // GtkWidget * gtk_bin_get_child (GtkBin *bin); 123 auto p = gtk_bin_get_child(gtkBin); 124 125 if(p is null) 126 { 127 return null; 128 } 129 130 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 131 } 132 }