#include <gtk/gtk.h>

int
main (int argc, char **argv)
{
  GtkWidget *widget, *scrolled_window;
  GtkWidget *window;
  gchar     *text;
  guint      i;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_size_request (window, 640, 480);
  g_signal_connect (window, "delete-event", gtk_main_quit, NULL);

  scrolled_window = gtk_scrolled_window_new (NULL, NULL);

  gtk_container_add (GTK_CONTAINER (window), scrolled_window);

  widget = gtk_list_box_new ();
  gtk_widget_set_margin_start (widget, 50);
  gtk_widget_set_margin_end (widget, 50);
  gtk_widget_set_margin_top (widget, 50);
  gtk_widget_set_margin_bottom (widget, 50);

  for (i = 0; i < 20; i++)
    {
      text = g_strdup_printf ("Item %d", i);
      gtk_list_box_insert (GTK_LIST_BOX (widget), gtk_label_new (text), i);
      g_free (text);
    }

  gtk_container_add (GTK_CONTAINER (scrolled_window), widget);

  gtk_widget_show_all (window);

  gtk_main ();

  return 0;
}
