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 = GtkImageMenuItem.html
27 * outFile = ImageMenuItem
28 * strct = GtkImageMenuItem
31 * clss = ImageMenuItem
39 * - gtk_image_menu_item_
44 * - gtk_image_menu_item_new_with_label
45 * - gtk_image_menu_item_new_with_mnemonic
51 * - GtkAccelGroup* -> AccelGroup
52 * - GtkWidget* -> Widget
56 module gtk
.ImageMenuItem
;
58 private import gtk
.gtktypes
;
60 private import lib
.gtk
;
62 private import glib
.Str
;
63 private import gtk
.Widget
;
64 private import gtk
.AccelGroup
;
68 * A GtkImageMenuItem is a menu item which has an icon next to the text label.
69 * Note that the user can disable display of menu icons, so make sure to still
70 * fill in the text label.
72 private import gtk
.MenuItem
;
73 public class ImageMenuItem
: MenuItem
76 /** the main Gtk struct */
77 protected GtkImageMenuItem
* gtkImageMenuItem
;
80 public GtkImageMenuItem
* getImageMenuItemStruct()
82 return gtkImageMenuItem
;
86 /** the main Gtk struct as a void* */
87 protected void* getStruct()
89 return cast(void*)gtkImageMenuItem
;
93 * Sets our main struct and passes it to the parent class
95 public this (GtkImageMenuItem
* gtkImageMenuItem
)
97 super(cast(GtkMenuItem
*)gtkImageMenuItem
);
98 this.gtkImageMenuItem
= gtkImageMenuItem
;
102 * Creates a new GtkImageMenuItem containing a label.
103 * If mnemonic it true the label
104 * will be created using gtk_label_new_with_mnemonic(), so underscores
105 * in label indicate the mnemonic for the menu item.
107 * the text of the menu item.
109 * a new GtkImageMenuItem.
111 public this (char[] label
, bit mnemonic
=true)
115 // GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label);
116 this(cast(GtkImageMenuItem
*)gtk_image_menu_item_new_with_mnemonic(Str
.toStringz(label
)) );
120 // GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label);
121 this(cast(GtkImageMenuItem
*)gtk_image_menu_item_new_with_label(Str
.toStringz(label
)) );
130 * Sets the image of image_menu_item to the given widget.
131 * Note that it depends on the show-menu-images setting whether
132 * the image will be displayed or not.
134 * a GtkImageMenuItem.
136 * a widget to set as the image for the menu item.
138 public void setImage(Widget image
)
140 // void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item, GtkWidget *image);
141 gtk_image_menu_item_set_image(gtkImageMenuItem
, (image
is null) ?
null : image
.getWidgetStruct());
145 * Gets the widget that is currently set as the image of image_menu_item.
146 * See gtk_image_menu_item_set_image().
148 * a GtkImageMenuItem.
150 * the widget set as image of image_menu_item.
152 public Widget
getImage()
154 // GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item);
155 return new Widget( gtk_image_menu_item_get_image(gtkImageMenuItem
) );
159 * Creates a new GtkImageMenuItem with an empty label.
161 * a new GtkImageMenuItem.
165 // GtkWidget* gtk_image_menu_item_new (void);
166 this(cast(GtkImageMenuItem
*)gtk_image_menu_item_new() );
170 * Creates a new GtkImageMenuItem containing the image and text from a
171 * stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK
172 * and GTK_STOCK_APPLY.
173 * If you want this menu item to have changeable accelerators, then pass in
174 * NULL for accel_group. Next call gtk_menu_item_set_accel_path() with an
175 * appropriate path for the menu item, use gtk_stock_lookup() to look up the
176 * standard accelerator for the stock item, and if one is found, call
177 * gtk_accel_map_add_entry() to register it.
179 * the name of the stock item.
181 * the GtkAccelGroup to add the menu items accelerator to,
184 * a new GtkImageMenuItem.
186 public this (char[] stockId
, AccelGroup accelGroup
)
188 // GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id, GtkAccelGroup *accel_group);
189 this(cast(GtkImageMenuItem
*)gtk_image_menu_item_new_from_stock(Str
.toStringz(stockId
), (accelGroup
is null) ?
null : accelGroup
.getAccelGroupStruct()) );