/* gcc -o box box.c $(pkg-config --cflags --libs gtk+-2.0) */

#include <gtk/gtk.h>

int main (int    argc,
          gchar* argv[])
{
  GtkWidget* dialog;
  GtkWidget* label;
  GtkWidget* hbox;
  GtkWidget* button_box;
  GtkWidget* vbox;
  GtkWidget* button;
  static const gchar* button_labels [] = { "Fehlerbehebung", "Feinstaub", "Feld" };
  gint i;


  gtk_init (&argc, &argv);
  g_set_application_name ("Testkiste");

  dialog = g_object_new (GTK_TYPE_DIALOG,
                         "icon-name", GTK_STOCK_ABOUT,
                         "title", "test",
                         "default-width", 400,
                         "default-height", 200,
                         NULL);
  g_signal_connect (dialog, "response",
                    G_CALLBACK (gtk_main_quit), dialog);

  hbox = gtk_hbox_new (FALSE, 2);

  button_box = gtk_vbutton_box_new ();
  gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box),
                             GTK_BUTTONBOX_START);

  for (i = 0; i < G_N_ELEMENTS (button_labels); i++)
  {
      button = gtk_button_new ();
      label = gtk_label_new (button_labels[i]);
      gtk_label_set_angle (GTK_LABEL (label), 90);
      gtk_container_add (GTK_CONTAINER (button), label);
      gtk_container_add (GTK_CONTAINER (button_box), button);
      if (i == 2)
          gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (button_box),
                                              button, TRUE);
  }

  gtk_widget_show_all (button_box);
  gtk_box_pack_start (GTK_BOX (hbox), button_box,
                      FALSE, FALSE, 2);

  vbox = gtk_vbox_new (FALSE, 2);

  gtk_widget_show (vbox);
  gtk_box_pack_start (GTK_BOX (hbox), vbox,
                      FALSE, FALSE, 2);

  gtk_widget_show (hbox);
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
                      TRUE, TRUE, 2);

  gtk_dialog_add_buttons (GTK_DIALOG (dialog),
                          "Werkseinstellungen", GTK_RESPONSE_HELP,
                          "Weltzeit", 1,
                          "Weg", GTK_RESPONSE_CANCEL,
                          "Wahrhaftich", GTK_RESPONSE_OK,
                          NULL);

  gtk_widget_show (dialog);

  gtk_main ();
}