#include <gtk/gtk.h>

#include <stdlib.h>

int
main (int argc, char **argv)
{
  g_assert (argc == 2);

  GtkOrientation orientation = atoi(argv[1]);
  g_assert (orientation == GTK_ORIENTATION_HORIZONTAL ||
            orientation == GTK_ORIENTATION_VERTICAL);

  gtk_init (&argc, &argv);

  GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_can_focus (window, FALSE);
  gtk_window_set_default_size ((GtkWindow *)window, 440, 250);

  GtkWidget *flow_box = gtk_flow_box_new ();
  gtk_widget_show (flow_box);
  gtk_widget_set_can_focus (flow_box, FALSE);
  gtk_orientable_set_orientation (GTK_ORIENTABLE (flow_box), orientation);

  for (guint i = 14; i--;)
    {
      gchar *label_text = g_strdup_printf ("RadioButton #%u", i); 
      GtkWidget *radio_button = gtk_radio_button_new_with_label (NULL, label_text);
      g_free (label_text);

      gtk_container_add ((GtkContainer *)flow_box, radio_button);
    }

  gtk_container_add ((GtkContainer *)window, flow_box);
  g_signal_connect (window, "delete-event", &gtk_main_quit, NULL);
  gtk_widget_show_all (window);
  gtk_main ();
}
