alternative to assert
[gtkD.git] / gtkD / src / gtk / Bin.d
blob31506f1047fafab79917f976fe32fe743cfd777b
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkBin.html
26 * outPack = gtk
27 * outFile = Bin
28 * strct = GtkBin
29 * realStrct=
30 * ctorStrct=
31 * clss = Bin
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_bin_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * - gtk_bin_get_child
45 * imports:
46 * - gtk.Widget
47 * structWrap:
48 * - GtkWidget* -> Widget
49 * module aliases:
50 * local aliases:
53 module gtk.Bin;
55 version(noAssert)
57 version(Tango)
59 import tango.io.Stdout; // use the tango loging?
63 private import gtkc.gtktypes;
65 private import gtkc.gtk;
68 private import gtk.Widget;
73 /**
74 * Description
75 * The GtkBin widget is a container with just one child.
76 * It is not very useful itself, but it is useful for deriving subclasses,
77 * since it provides common code needed for handling a single child widget.
78 * Many GTK+ widgets are subclasses of GtkBin, including GtkWindow, GtkButton,
79 * GtkFrame, GtkHandleBox, and GtkScrolledWindow.
81 private import gtk.Container;
82 public class Bin : Container
85 /** the main Gtk struct */
86 protected GtkBin* gtkBin;
89 public GtkBin* getBinStruct()
91 return gtkBin;
95 /** the main Gtk struct as a void* */
96 protected void* getStruct()
98 return cast(void*)gtkBin;
102 * Sets our main struct and passes it to the parent class
104 public this (GtkBin* gtkBin)
106 version(noAssert)
108 if ( gtkBin is null )
110 int zero = 0;
111 version(Tango)
113 Stdout("struct gtkBin is null on constructor").newline;
115 else
117 printf("struct gtkBin is null on constructor");
119 zero = zero / zero;
122 else
124 assert(gtkBin !is null, "struct gtkBin is null on constructor");
126 super(cast(GtkContainer*)gtkBin);
127 this.gtkBin = gtkBin;
131 * Gets the child of the GtkBin, or NULL if the bin contains
132 * no child widget. The returned widget does not have a reference
133 * added, so you do not need to unref it.
134 * bin:
135 * a GtkBin
136 * Returns:
137 * pointer to child of the GtkBin
139 public Widget getChild()
141 // GtkWidget* gtk_bin_get_child (GtkBin *bin);
142 GtkWidget * gtkWidget = gtk_bin_get_child(gtkBin);
143 if ( gtkWidget )
145 return new Widget(gtkWidget);
147 else
149 return null;