/*
 * Compile with:
 *   gcc -o menu menu.c `pkg-config --libs --cflags gtk+-3.0`
 */

#include <gtk/gtk.h>

int main( int argc, char *argv[])
{
  gtk_init(&argc, &argv);

  GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size(GTK_WINDOW(window), 250, 200);

  GtkWidget *vbox = gtk_vbox_new(FALSE, 0);
  gtk_container_add(GTK_CONTAINER(window), vbox);

  GtkWidget *menubar = gtk_menu_bar_new();
  GtkWidget *menu = gtk_menu_new();

  GtkWidget *menuitem = gtk_menu_item_new_with_mnemonic("_File");
  gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
  gtk_menu_shell_append(GTK_MENU_SHELL(menu), \
          gtk_image_menu_item_new_from_stock(GTK_STOCK_NEW, NULL));
  gtk_menu_shell_append(GTK_MENU_SHELL(menu), \
          gtk_separator_menu_item_new());
  gtk_menu_shell_append(GTK_MENU_SHELL(menu), \
          gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL));
  gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menuitem);
  gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);

  g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), \
          NULL);

  gtk_widget_show_all(window);

  gtk_main();

  return 0;
}
