Changeset 531
- Timestamp:
- 07/13/08 16:33:46 (2 months ago)
- Files:
-
- trunk/src/gobject/ObjectG.d (modified) (1 diff)
- trunk/src/gtk/ImageMenuItem.d (modified) (4 diffs)
- trunk/wrap/APILookupGtk.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/gobject/ObjectG.d
r530 r531 180 180 * data = a pointer 181 181 */ 182 public :void objectGSetDataFull(string key, gpointer data)182 public void objectGSetDataFull(string key, gpointer data) 183 183 { 184 184 //writefln("setData objectG=%X data=%X type %s",gObject,data,key); trunk/src/gtk/ImageMenuItem.d
r530 r531 44 44 * - gtk_image_menu_item_new_with_label 45 45 * - gtk_image_menu_item_new_with_mnemonic 46 * - gtk_image_menu_item_new_from_stock 46 47 * omit signals: 47 48 * imports: … … 143 144 144 145 /** 145 */146 147 /**148 * Sets the image of image_menu_item to the given widget.149 * Note that it depends on the show-menu-images setting whether150 * the image will be displayed or not.151 * Params:152 * image = a widget to set as the image for the menu item.153 */154 public void setImage(Widget image)155 {156 // void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item, GtkWidget *image);157 gtk_image_menu_item_set_image(gtkImageMenuItem, (image is null) ? null : image.getWidgetStruct());158 }159 160 /**161 * Gets the widget that is currently set as the image of image_menu_item.162 * See gtk_image_menu_item_set_image().163 * Returns: the widget set as image of image_menu_item.164 */165 public Widget getImage()166 {167 // GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item);168 auto p = gtk_image_menu_item_get_image(gtkImageMenuItem);169 if(p is null)170 {171 return null;172 }173 return new Widget(cast(GtkWidget*) p);174 }175 176 /**177 * Creates a new GtkImageMenuItem with an empty label.178 */179 public this ()180 {181 // GtkWidget* gtk_image_menu_item_new (void);182 auto p = gtk_image_menu_item_new();183 if(p is null)184 {185 throw new Exception("Construction failure.");186 }187 this(cast(GtkImageMenuItem*) p);188 }189 190 /**191 146 * Creates a new GtkImageMenuItem containing the image and text from a 192 147 * stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK … … 198 153 * gtk_accel_map_add_entry() to register it. 199 154 * Params: 200 * stockId = the name of the stock item.155 * StockID = the name of the stock item 201 156 * accelGroup = the GtkAccelGroup to add the menu items accelerator to, 202 157 * or NULL. 203 158 */ 204 public this ( string stockId, AccelGroup accelGroup)159 public this (StockID stockID, AccelGroup accelGroup) 205 160 { 206 161 // GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id, GtkAccelGroup *accel_group); 207 auto p = gtk_image_menu_item_new_from_stock(Str.toStringz( stockId), (accelGroup is null) ? null : accelGroup.getAccelGroupStruct());162 auto p = gtk_image_menu_item_new_from_stock(Str.toStringz(StockDesc[stockID]), (accelGroup is null) ? null : accelGroup.getAccelGroupStruct()); 208 163 if(p is null) 209 164 { … … 212 167 this(cast(GtkImageMenuItem*) p); 213 168 } 169 170 /** 171 */ 172 173 /** 174 * Sets the image of image_menu_item to the given widget. 175 * Note that it depends on the show-menu-images setting whether 176 * the image will be displayed or not. 177 * Params: 178 * image = a widget to set as the image for the menu item. 179 */ 180 public void setImage(Widget image) 181 { 182 // void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item, GtkWidget *image); 183 gtk_image_menu_item_set_image(gtkImageMenuItem, (image is null) ? null : image.getWidgetStruct()); 184 } 185 186 /** 187 * Gets the widget that is currently set as the image of image_menu_item. 188 * See gtk_image_menu_item_set_image(). 189 * Returns: the widget set as image of image_menu_item. 190 */ 191 public Widget getImage() 192 { 193 // GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item); 194 auto p = gtk_image_menu_item_get_image(gtkImageMenuItem); 195 if(p is null) 196 { 197 return null; 198 } 199 return new Widget(cast(GtkWidget*) p); 200 } 201 202 /** 203 * Creates a new GtkImageMenuItem with an empty label. 204 */ 205 public this () 206 { 207 // GtkWidget* gtk_image_menu_item_new (void); 208 auto p = gtk_image_menu_item_new(); 209 if(p is null) 210 { 211 throw new Exception("Construction failure."); 212 } 213 this(cast(GtkImageMenuItem*) p); 214 } 214 215 } trunk/wrap/APILookupGtk.txt
r525 r531 4303 4303 nocode: gtk_image_menu_item_new_with_label 4304 4304 nocode: gtk_image_menu_item_new_with_mnemonic 4305 nocode: gtk_image_menu_item_new_from_stock 4305 4306 4306 4307 code: start … … 4327 4328 this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_label(Str.toStringz(label)) ); 4328 4329 } 4330 } 4331 4332 /** 4333 * Creates a new GtkImageMenuItem containing the image and text from a 4334 * stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK 4335 * and GTK_STOCK_APPLY. 4336 * If you want this menu item to have changeable accelerators, then pass in 4337 * NULL for accel_group. Next call gtk_menu_item_set_accel_path() with an 4338 * appropriate path for the menu item, use gtk_stock_lookup() to look up the 4339 * standard accelerator for the stock item, and if one is found, call 4340 * gtk_accel_map_add_entry() to register it. 4341 * Params: 4342 * StockID = the name of the stock item 4343 * accelGroup = the GtkAccelGroup to add the menu items accelerator to, 4344 * or NULL. 4345 */ 4346 public this (StockID stockID, AccelGroup accelGroup) 4347 { 4348 // GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id, GtkAccelGroup *accel_group); 4349 auto p = gtk_image_menu_item_new_from_stock(Str.toStringz(StockDesc[stockID]), (accelGroup is null) ? null : accelGroup.getAccelGroupStruct()); 4350 if(p is null) 4351 { 4352 throw new Exception("Construction failure."); 4353 } 4354 this(cast(GtkImageMenuItem*) p); 4329 4355 } 4330 4356 code: end
