#include <gtk/gtk.h>

int main (int argc, char **argv)
{
  GtkWindow *main_window;
  GtkWidget *headerbar;
  GtkWidget *bar_box;
  GtkWidget *win_box;
  GtkWidget *bar_spin;
  GtkWidget *win_spin;
  
  gtk_init (&argc, &argv);

  main_window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
  headerbar = GTK_WIDGET (gtk_header_bar_new ());
  gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
  gtk_window_set_titlebar (main_window, headerbar);
  bar_box = GTK_WIDGET (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
  win_box = GTK_WIDGET (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
  win_spin = gtk_spin_button_new_with_range (0, 1000, 1);
  bar_spin = gtk_spin_button_new_with_range (0, 1000, 1);
  gtk_widget_set_valign (bar_spin, GTK_ALIGN_CENTER);
  g_object_set (G_OBJECT (bar_spin), "expand", FALSE, NULL);
  gtk_container_add (GTK_CONTAINER (main_window), win_box);
  gtk_container_add (GTK_CONTAINER (headerbar), bar_box);
  gtk_box_pack_start (GTK_BOX (win_box), win_spin, FALSE, FALSE, 0);
  gtk_box_pack_start (GTK_BOX (bar_box), bar_spin, FALSE, FALSE, 0);

  g_signal_connect(G_OBJECT (main_window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
  gtk_widget_show_all (GTK_WIDGET (main_window));

  gtk_main ();

  return 0;
}
