diff src/ui_menu.c @ 1667:0806ccdfe06b

simplified menu_item_add_radio usage
author nadvornik
date Sat, 27 Jun 2009 20:12:56 +0000
parents 89dedc61b1bd
children 956aab097ea7
line wrap: on
line diff
--- a/src/ui_menu.c	Sat Jun 27 17:54:31 2009 +0000
+++ b/src/ui_menu.c	Sat Jun 27 20:12:56 2009 +0000
@@ -97,18 +97,12 @@
 	return item;
 }
 
-GtkWidget *menu_item_add_radio(GtkWidget *menu, GtkWidget *parent,
-			       const gchar *label, gboolean active,
+GtkWidget *menu_item_add_radio(GtkWidget *menu, const gchar *label, gpointer item_data, gboolean active,
 			       GCallback func, gpointer data)
 {
-	GtkWidget *item;
-	GSList *group = NULL;
-
-	if (parent) group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(parent));
-
-	item = gtk_radio_menu_item_new_with_mnemonic(group, label);
-	if (active) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), active);
-	menu_item_finish(menu, item, func, data);
+	GtkWidget *item = menu_item_add_check(menu, label, active, func, data);
+	g_object_set_data(G_OBJECT(item), "menu_item_radio_data", item_data);
+	g_object_set(G_OBJECT(item), "draw-as-radio", TRUE, NULL);
 
 	return item;
 }