alternative to assert
[gtkD.git] / gtkD / src / gtk / MenuBar.d
blob0eff452c253adb5725297fd99c64a22074965e17
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 = GtkMenuBar.html
26 * outPack = gtk
27 * outFile = MenuBar
28 * strct = GtkMenuBar
29 * realStrct=
30 * ctorStrct=
31 * clss = MenuBar
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_menu_bar_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - gtk.Widget
46 * - gtk.Menu;
47 * - gtk.MenuItem;
48 * structWrap:
49 * - GtkMenu* -> Menu
50 * - GtkMenuItem* -> MenuItem
51 * - GtkWidget* -> Widget
52 * module aliases:
53 * local aliases:
56 module gtk.MenuBar;
58 version(noAssert)
60 version(Tango)
62 import tango.io.Stdout; // use the tango loging?
66 private import gtkc.gtktypes;
68 private import gtkc.gtk;
71 private import gtk.Widget;
72 private import gtk.Menu;;
73 private import gtk.MenuItem;;
78 /**
79 * Description
80 * The GtkMenuBar is a subclass of GtkMenuShell which contains one to many GtkMenuItem. The result is a standard menu bar which can hold many menu items. GtkMenuBar allows for a shadow type to be set for aesthetic purposes. The shadow types are defined in the gtk_menu_bar_set_shadow_type function.
82 private import gtk.MenuShell;
83 public class MenuBar : MenuShell
86 /** the main Gtk struct */
87 protected GtkMenuBar* gtkMenuBar;
90 public GtkMenuBar* getMenuBarStruct()
92 return gtkMenuBar;
96 /** the main Gtk struct as a void* */
97 protected void* getStruct()
99 return cast(void*)gtkMenuBar;
103 * Sets our main struct and passes it to the parent class
105 public this (GtkMenuBar* gtkMenuBar)
107 version(noAssert)
109 if ( gtkMenuBar is null )
111 int zero = 0;
112 version(Tango)
114 Stdout("struct gtkMenuBar is null on constructor").newline;
116 else
118 printf("struct gtkMenuBar is null on constructor");
120 zero = zero / zero;
123 else
125 assert(gtkMenuBar !is null, "struct gtkMenuBar is null on constructor");
127 super(cast(GtkMenuShell*)gtkMenuBar);
128 this.gtkMenuBar = gtkMenuBar;
131 Menu append(char[] label, bool rightJustify=false)
133 MenuItem item = new MenuItem(label);
134 super.append(item);
135 item.setRightJustified(rightJustify);
136 Menu menu= new Menu();
137 item.setSubmenu(menu);
138 return menu;
141 public void append(Widget widget)
143 super.append(widget);
151 * Creates the new GtkMenuBar
152 * Returns:
153 * the GtkMenuBar
155 public this ()
157 // GtkWidget* gtk_menu_bar_new (void);
158 this(cast(GtkMenuBar*)gtk_menu_bar_new() );
166 * Sets how items should be packed inside a menubar.
167 * menubar:
168 * a GtkMenuBar.
169 * pack_dir:
170 * a new GtkPackDirection.
171 * Since 2.8
173 public void setPackDirection(GtkPackDirection packDir)
175 // void gtk_menu_bar_set_pack_direction (GtkMenuBar *menubar, GtkPackDirection pack_dir);
176 gtk_menu_bar_set_pack_direction(gtkMenuBar, packDir);
180 * Retrieves the current pack direction of the menubar. See
181 * gtk_menu_bar_set_pack_direction().
182 * menubar:
183 * a GtkMenuBar
184 * Returns:
185 * the pack direction
186 * Since 2.8
188 public GtkPackDirection getPackDirection()
190 // GtkPackDirection gtk_menu_bar_get_pack_direction (GtkMenuBar *menubar);
191 return gtk_menu_bar_get_pack_direction(gtkMenuBar);
195 * Sets how widgets should be packed inside the children of a menubar.
196 * menubar:
197 * a GtkMenuBar.
198 * child_pack_dir:
199 * a new GtkPackDirection.
200 * Since 2.8
202 public void setChildPackDirection(GtkPackDirection childPackDir)
204 // void gtk_menu_bar_set_child_pack_direction (GtkMenuBar *menubar, GtkPackDirection child_pack_dir);
205 gtk_menu_bar_set_child_pack_direction(gtkMenuBar, childPackDir);
209 * Retrieves the current child pack direction of the menubar. See
210 * gtk_menu_bar_set_child_pack_direction().
211 * menubar:
212 * a GtkMenuBar
213 * Returns:
214 * the child pack direction
215 * Since 2.8
216 * Property Details
217 * The "child-pack-direction" property
218 * "child-pack-direction" GtkPackDirection : Read / Write
219 * The pack direction of the menubar. It determines how
220 * the widgets contained in child menuitems are arranged.
221 * Default value: GTK_PACK_DIRECTION_LTR
222 * Since 2.8
224 public GtkPackDirection getChildPackDirection()
226 // GtkPackDirection gtk_menu_bar_get_child_pack_direction (GtkMenuBar *menubar);
227 return gtk_menu_bar_get_child_pack_direction(gtkMenuBar);