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 private import gtk.Widget; 63 64 65 private import gtk.Container; 66 67 /** 68 * The GtkBin widget is a container with just one child. 69 * It is not very useful itself, but it is useful for deriving subclasses, 70 * since it provides common code needed for handling a single child widget. 71 * 72 * Many GTK+ widgets are subclasses of GtkBin, including GtkWindow, 73 * GtkButton, GtkFrame, GtkHandleBox or GtkScrolledWindow. 74 */ 75 public class Bin : Container 76 { 77 78 /** the main Gtk struct */ 79 protected GtkBin* gtkBin; 80 81 82 /** Get the main Gtk struct */ 83 public GtkBin* getBinStruct() 84 { 85 return gtkBin; 86 } 87 88 89 /** the main Gtk struct as a void* */ 90 protected override void* getStruct() 91 { 92 return cast(void*)gtkBin; 93 } 94 95 /** 96 * Sets our main struct and passes it to the parent class 97 */ 98 public this (GtkBin* gtkBin) 99 { 100 super(cast(GtkContainer*)gtkBin); 101 this.gtkBin = gtkBin; 102 } 103 104 protected override void setStruct(GObject* obj) 105 { 106 super.setStruct(obj); 107 gtkBin = cast(GtkBin*)obj; 108 } 109 110 /** 111 */ 112 113 /** 114 * Gets the child of the GtkBin, or NULL if the bin contains 115 * no child widget. The returned widget does not have a reference 116 * added, so you do not need to unref it. 117 * Returns: pointer to child of the GtkBin. [transfer none] 118 */ 119 public Widget getChild() 120 { 121 // GtkWidget * gtk_bin_get_child (GtkBin *bin); 122 auto p = gtk_bin_get_child(gtkBin); 123 124 if(p is null) 125 { 126 return null; 127 } 128 129 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 130 } 131 }