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


void printit(GtkRange *range, gpointer dummy)
{
	g_print("scale: %f\n", gtk_range_get_value(range));
}

int main (int argc, char *argv[])
{
	GtkWidget *vscale;
	GtkWidget *window;
	GtkObject *adjustment;
 
	gtk_init (&argc, &argv);
 
	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	gtk_window_set_default_size (GTK_WINDOW(window), 200, 200);
 
	adjustment = gtk_adjustment_new (0, 0, 9, 0, 0, 0);
	vscale = gtk_vscale_new (GTK_ADJUSTMENT(adjustment));
	gtk_scale_set_digits (GTK_SCALE(vscale), 0);
	gtk_scale_set_draw_value(GTK_SCALE(vscale), atoi(argv[1]));
	g_signal_connect(GTK_RANGE(vscale), "value-changed",
			G_CALLBACK(printit), NULL);
 
	gtk_container_add (GTK_CONTAINER(window), vscale);

	gtk_widget_show_all (window);
 
	gtk_main ();
 
	return 0;
}
