alternative to assert
[gtkD.git] / src / gtk / MenuBar.d
blob40b11134cb88139535dc4e67e7a52550f291e3a4
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 * local aliases:
55 module gtk.MenuBar;
57 private import gtk.gtktypes;
59 private import lib.gtk;
61 private import gtk.Widget;
62 private import gtk.Menu;;
63 private import gtk.MenuItem;;
65 /**
66 * Description
67 * 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.
69 private import gtk.MenuShell;
70 public class MenuBar : MenuShell
73 /** the main Gtk struct */
74 protected GtkMenuBar* gtkMenuBar;
77 public GtkMenuBar* getMenuBarStruct()
79 return gtkMenuBar;
83 /** the main Gtk struct as a void* */
84 protected void* getStruct()
86 return cast(void*)gtkMenuBar;
89 /**
90 * Sets our main struct and passes it to the parent class
92 public this (GtkMenuBar* gtkMenuBar)
94 super(cast(GtkMenuShell*)gtkMenuBar);
95 this.gtkMenuBar = gtkMenuBar;
98 Menu append(char[] label, bool rightJustify=false)
100 MenuItem item = new MenuItem(label);
101 super.append(item);
102 item.setRightJustified(rightJustify);
103 Menu menu= new Menu();
104 item.setSubmenu(menu);
105 return menu;
108 public void append(Widget widget)
110 super.append(widget);
118 * Creates the new GtkMenuBar
119 * Returns:
120 * the GtkMenuBar
122 public this ()
124 // GtkWidget* gtk_menu_bar_new (void);
125 this(cast(GtkMenuBar*)gtk_menu_bar_new() );
133 * Sets how items should be packed inside a menubar.
134 * menubar:
135 * a GtkMenuBar.
136 * pack_dir:
137 * a new GtkPackDirection.
138 * Since 2.8
140 public void setPackDirection(GtkPackDirection packDir)
142 // void gtk_menu_bar_set_pack_direction (GtkMenuBar *menubar, GtkPackDirection pack_dir);
143 gtk_menu_bar_set_pack_direction(gtkMenuBar, packDir);
147 * Retrieves the current pack direction of the menubar. See
148 * gtk_menu_bar_set_pack_direction().
149 * menubar:
150 * a GtkMenuBar
151 * Returns:
152 * the pack direction
153 * Since 2.8
155 public GtkPackDirection getPackDirection()
157 // GtkPackDirection gtk_menu_bar_get_pack_direction (GtkMenuBar *menubar);
158 return gtk_menu_bar_get_pack_direction(gtkMenuBar);
162 * Sets how widgets should be packed inside the children of a menubar.
163 * menubar:
164 * a GtkMenuBar.
165 * child_pack_dir:
166 * a new GtkPackDirection.
167 * Since 2.8
169 public void setChildPackDirection(GtkPackDirection childPackDir)
171 // void gtk_menu_bar_set_child_pack_direction (GtkMenuBar *menubar, GtkPackDirection child_pack_dir);
172 gtk_menu_bar_set_child_pack_direction(gtkMenuBar, childPackDir);
176 * Retrieves the current child pack direction of the menubar. See
177 * gtk_menu_bar_set_child_pack_direction().
178 * menubar:
179 * a GtkMenuBar
180 * Returns:
181 * the child pack direction
182 * Since 2.8
183 * Property Details
184 * The "child-pack-direction" property
185 * "child-pack-direction" GtkPackDirection : Read / Write
186 * The pack direction of the menubar. It determines how
187 * the widgets contained in child menuitems are arranged.
188 * Default value: GTK_PACK_DIRECTION_LTR
189 * Since 2.8
191 public GtkPackDirection getChildPackDirection()
193 // GtkPackDirection gtk_menu_bar_get_child_pack_direction (GtkMenuBar *menubar);
194 return gtk_menu_bar_get_child_pack_direction(gtkMenuBar);