aboutsummaryrefslogtreecommitdiff
path: root/example/menus.c
diff options
context:
space:
mode:
authorCody Russell <crussell@canonical.com>2010-01-19 16:02:50 -0600
committerCody Russell <crussell@canonical.com>2010-01-19 16:02:50 -0600
commitebb7b05f5a94c0974894f41991af3185f2560598 (patch)
treeb8bd5cc86d9eaa8e486a9aa0eca09aa985b84857 /example/menus.c
downloadayatana-ido-ebb7b05f5a94c0974894f41991af3185f2560598.tar.gz
ayatana-ido-ebb7b05f5a94c0974894f41991af3185f2560598.tar.bz2
ayatana-ido-ebb7b05f5a94c0974894f41991af3185f2560598.zip
IDO initial commit, scale menuitem
Diffstat (limited to 'example/menus.c')
-rw-r--r--example/menus.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/example/menus.c b/example/menus.c
new file mode 100644
index 0000000..c27fc14
--- /dev/null
+++ b/example/menus.c
@@ -0,0 +1,51 @@
+#include <gtk/gtk.h>
+
+#include "idoscalemenuitem.h"
+
+int
+main (int argc, char *argv[])
+{
+ GtkWidget *window;
+ GtkWidget *vbox;
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+ GtkWidget *root;
+ GtkWidget *menubar;
+
+ gtk_init (&argc, &argv);
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title (GTK_WINDOW (window), "Menus");
+ gtk_widget_set_size_request (window, 300, 200);
+ g_signal_connect (window, "delete-event",
+ G_CALLBACK (gtk_main_quit), NULL);
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (window), vbox);
+
+ menubar = gtk_menu_bar_new ();
+ gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
+
+ menu = gtk_menu_new ();
+
+ root = gtk_menu_item_new_with_label ("File");
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (root), menu);
+
+ menuitem = gtk_menu_item_new_with_label ("New");
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("Open");
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ menuitem = ido_scale_menu_item_new_with_range ("Volume", 0, 100, 1);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ /* Add the menubar */
+ gtk_menu_shell_append (GTK_MENU_SHELL (menubar), root);
+
+ gtk_widget_show_all (window);
+
+ gtk_main ();
+
+ return 0;
+}