Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=grape.git;a=commitdiff;h=29b000f6d546054655ee51d7a0c6e4828908df92

commit 29b000f6d546054655ee51d7a0c6e4828908df92
Author: James Buren <r...@frugalware.org>
Date:   Fri Apr 9 17:32:26 2010 -0500

grape.c
* add insert_menu_items function

diff --git a/src/grape.c b/src/grape.c
index 3548b10..39967c7 100644
--- a/src/grape.c
+++ b/src/grape.c
@@ -131,6 +131,22 @@ GtkWidget *image_menu_item_new(const gchar 
*stock,MenuOrButtonCallback signal) {
return menu_item;
}

+/* Insert menu items into a menu. Must be passed a valid flow of
+   GtkMenuItems, the last one followed by NULL. */
+void insert_menu_items(GtkWidget *menu,...) {
+  va_list args;
+  GtkWidget *child;
+
+  g_assert(menu != NULL);
+
+  va_start(args,menu);
+
+  while((child = va_arg(args,GtkWidget *)))
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu),child);
+
+  va_end(args);
+}
+
/* Lets get this show on the road */
gint main(gint argc,gchar **argv) {
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to