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()
This commit is contained in:
Alexander Larsson 2001-03-21 08:56:25 +00:00 committed by Alexander Larsson
parent 23d5d52912
commit a24e9b1074
9 changed files with 77 additions and 6 deletions

View File

@ -1,3 +1,8 @@
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):

View File

@ -1,3 +1,8 @@
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):

View File

@ -1,3 +1,8 @@
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):

View File

@ -1,3 +1,8 @@
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):

View File

@ -1,3 +1,8 @@
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):

View File

@ -1,3 +1,8 @@
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):

View File

@ -1,3 +1,8 @@
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):

View File

@ -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)

View File

@ -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
}