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
50 * - GtkMenuItem* -> MenuItem
51 * - GtkWidget* -> Widget
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
;;
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()
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
)
109 if ( gtkMenuBar
is null )
114 Stdout("struct gtkMenuBar is null on constructor").newline
;
118 printf("struct gtkMenuBar is null on constructor");
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
);
135 item
.setRightJustified(rightJustify
);
136 Menu menu
= new Menu();
137 item
.setSubmenu(menu
);
141 public void append(Widget widget
)
143 super.append(widget
);
151 * Creates the new GtkMenuBar
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.
170 * a new GtkPackDirection.
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().
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.
199 * a new GtkPackDirection.
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().
214 * the child pack direction
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
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
);