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.VBox;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Box;
30 private import gtk.Widget;
31 private import gtk.c.functions;
32 public  import gtk.c.types;
33 public  import gtkc.gtktypes;
34 
35 
36 /**
37  * A #GtkVBox is a container that organizes child widgets into a single column.
38  * 
39  * Use the #GtkBox packing interface to determine the arrangement,
40  * spacing, height, and alignment of #GtkVBox children.
41  * 
42  * All children are allocated the same width.
43  * 
44  * GtkVBox has been deprecated. You can use #GtkBox instead, which is a
45  * very quick and easy change. If you have derived your own classes from
46  * GtkVBox, you can simply change the inheritance to derive directly
47  * from #GtkBox, and set the #GtkOrientable:orientation property to
48  * %GTK_ORIENTATION_VERTICAL in your instance init function, with a
49  * call like:
50  * |[<!-- language="C" -->
51  * gtk_orientable_set_orientation (GTK_ORIENTABLE (object),
52  * GTK_ORIENTATION_VERTICAL);
53  * ]|
54  * If you don’t need first-child or last-child styling and want your code
55  * to be future-proof, the recommendation is to switch to #GtkGrid instead
56  * of nested boxes. For more information about migrating to #GtkGrid,
57  * see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
58  */
59 public class VBox : Box
60 {
61 	/** the main Gtk struct */
62 	protected GtkVBox* gtkVBox;
63 
64 	/** Get the main Gtk struct */
65 	public GtkVBox* getVBoxStruct(bool transferOwnership = false)
66 	{
67 		if (transferOwnership)
68 			ownedRef = false;
69 		return gtkVBox;
70 	}
71 
72 	/** the main Gtk struct as a void* */
73 	protected override void* getStruct()
74 	{
75 		return cast(void*)gtkVBox;
76 	}
77 
78 	protected override void setStruct(GObject* obj)
79 	{
80 		gtkVBox = cast(GtkVBox*)obj;
81 		super.setStruct(obj);
82 	}
83 
84 	/**
85 	 * Sets our main struct and passes it to the parent class.
86 	 */
87 	public this (GtkVBox* gtkVBox, bool ownedRef = false)
88 	{
89 		this.gtkVBox = gtkVBox;
90 		super(cast(GtkBox*)gtkVBox, ownedRef);
91 	}
92 
93 
94 	/** */
95 	public static GType getType()
96 	{
97 		return gtk_vbox_get_type();
98 	}
99 
100 	/**
101 	 * Creates a new #GtkVBox.
102 	 *
103 	 * Deprecated: You can use gtk_box_new() with %GTK_ORIENTATION_VERTICAL instead,
104 	 * which is a quick and easy change. But the recommendation is to switch to
105 	 * #GtkGrid, since #GtkBox is going to go away eventually.
106 	 * See [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
107 	 *
108 	 * Params:
109 	 *     homogeneous = %TRUE if all children are to be given equal space allotments.
110 	 *     spacing = the number of pixels to place by default between children.
111 	 *
112 	 * Returns: a new #GtkVBox.
113 	 *
114 	 * Throws: ConstructionException GTK+ fails to create the object.
115 	 */
116 	public this(bool homogeneous, int spacing)
117 	{
118 		auto p = gtk_vbox_new(homogeneous, spacing);
119 
120 		if(p is null)
121 		{
122 			throw new ConstructionException("null returned by new");
123 		}
124 
125 		this(cast(GtkVBox*) p);
126 	}
127 }