#include <gtk/gtk.h>
#include <stdio.h>

static void callback(GtkWidget * w, gpointer d)
{
	printf("Changed to %d\n", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w)));
}

int
main (int argc, char *argv[])
{
  gtk_init (&argc, &argv);

  GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_set_border_width(GTK_CONTAINER(window), 5);
  
	GtkWidget * spin = gtk_spin_button_new_with_range(1, 10, 1);
	g_signal_connect(G_OBJECT(spin), "value-changed", G_CALLBACK(callback), NULL);

gtk_container_add(GTK_CONTAINER(window), spin);
gtk_widget_show_all(window);

gtk_main();
return 0;
}
