#include <glib.h>
#include <gtk/gtk.h>
#include <stdio.h>
#include "egg-flow-box.h"

int main (int argc, char **argv) {
  GtkWidget *w, *sw, *f, *button, *box;
  int i;
  char l[50];

  gtk_init (&argc, &argv);

  w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  sw = gtk_scrolled_window_new (NULL, NULL);
  gtk_container_add (GTK_CONTAINER (w), sw);

  f = g_object_new (EGG_TYPE_FLOW_BOX,
                    "horizontal-spacing", 5,
                    "vertical-spacing", 5,
                    "margin-left", 25,
                    "margin-right", 25,
                    "margin-top", 25,
                    "margin-bottom", 25,
                    "homogeneous", TRUE,
                    NULL);
  gtk_container_add (GTK_CONTAINER (sw), f);

  for (i=1; i<=20; i++) {
    sprintf (l, "Button %d", i);
    button = gtk_button_new_with_label (l);
    gtk_container_add (GTK_CONTAINER (f), button);
  }

  gtk_window_set_default_size (GTK_WINDOW (w), 400, 280);
  g_signal_connect (w, "destroy", G_CALLBACK (gtk_main_quit), NULL);
  gtk_widget_show_all (w);
  gtk_main ();
  return 0;
}
