Commit a24e9b10 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Add gtk_image_menu_item_new_from_stock()

2001-03-21  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkimagemenuitem.[c]:
	Add gtk_image_menu_item_new_from_stock()
parent 23d5d529
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
Add gtk_image_menu_item_new_from_stock()
Tue Mar 20 15:00:43 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
Add gtk_image_menu_item_new_from_stock()
Tue Mar 20 15:00:43 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
Add gtk_image_menu_item_new_from_stock()
Tue Mar 20 15:00:43 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
Add gtk_image_menu_item_new_from_stock()
Tue Mar 20 15:00:43 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
Add gtk_image_menu_item_new_from_stock()
Tue Mar 20 15:00:43 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
Add gtk_image_menu_item_new_from_stock()
Tue Mar 20 15:00:43 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
Add gtk_image_menu_item_new_from_stock()
Tue Mar 20 15:00:43 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
......
......@@ -28,6 +28,9 @@
#include "gtkaccellabel.h"
#include "gtksignal.h"
#include "gtkintl.h"
#include "gtkstock.h"
#include "gtkiconfactory.h"
#include "gtkimage.h"
static void gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass);
static void gtk_image_menu_item_init (GtkImageMenuItem *image_menu_item);
......@@ -359,6 +362,37 @@ gtk_image_menu_item_new (GtkWidget *widget,
return GTK_WIDGET(image_menu_item);
}
GtkWidget*
gtk_image_menu_item_new_from_stock (const gchar *stock_id,
GtkAccelGroup *accel_group)
{
GtkWidget *image;
GtkStockItem stock_item;
GtkWidget *item;
g_return_val_if_fail (stock_id != NULL, NULL);
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
if (gtk_stock_lookup (stock_id, &stock_item))
{
item = gtk_image_menu_item_new (image, stock_item.label);
if (stock_item.keyval && accel_group)
gtk_widget_add_accelerator (item,
"activate",
accel_group,
stock_item.keyval,
stock_item.modifier,
GTK_ACCEL_VISIBLE);
}
else
item = gtk_image_menu_item_new (image, stock_id);
gtk_widget_show (image);
return item;
}
void
gtk_image_menu_item_add_image (GtkImageMenuItem *image_menu_item,
GtkWidget *child)
......
......@@ -62,12 +62,14 @@ struct _GtkImageMenuItemClass
};
GtkType gtk_image_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_image_menu_item_new (GtkWidget *widget,
const gchar *label);
void gtk_image_menu_item_add_image (GtkImageMenuItem *image_menu_item,
GtkWidget *child);
GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item);
GtkType gtk_image_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_image_menu_item_new (GtkWidget *widget,
const gchar *label);
GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id,
GtkAccelGroup *accel_group);
void gtk_image_menu_item_add_image (GtkImageMenuItem *image_menu_item,
GtkWidget *child);
GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item);
#ifdef __cplusplus
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment