/* gcc $(pkg-config --cflags gtk+-2.0 --libs) test.c -o test */
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <gtk/gtk.h>

int main(int argc, char *argv[])
{
  GtkWidget *window, *vbox, *optionmenu, *menu;
  int i;

  gtk_set_locale();
  gtk_init(&argc, &argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title(GTK_WINDOW(window), "OptioMenu demonstration");

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

  optionmenu = gtk_option_menu_new();
  gtk_widget_show(optionmenu);
  gtk_box_pack_start(GTK_BOX(vbox), optionmenu, FALSE, FALSE, 0);

  menu = gtk_menu_new();

  for (i = 0; i < 200; i++) {
       char str[200];
       GtkWidget *item;  
       sprintf(str, "item %d", i);
       item = gtk_menu_item_new_with_mnemonic(str);
       gtk_widget_show(item);
       gtk_container_add(GTK_CONTAINER(menu), item);
  }

  gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu), menu);

  gtk_widget_show(window);

  gtk_main();
  return 0;
}

