1 /* testspinbutton.c
2  * Copyright (C) 2004 Morten Welinder
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 
20 #include "config.h"
21 #include <gtk/gtk.h>
22 
23 int
main(int argc,char ** argv)24 main (int argc, char **argv)
25 {
26         GtkWidget *window, *mainbox;
27 	int max;
28 
29         gtk_init (&argc, &argv);
30 
31         window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
32         g_signal_connect (window, "delete_event", gtk_main_quit, NULL);
33 
34         mainbox = gtk_vbox_new (FALSE, 2);
35         gtk_container_add (GTK_CONTAINER (window), mainbox);
36 
37 	for (max = 9; max <= 999999999; max = max * 10 + 9) {
38 		GtkAdjustment *adj =
39 			GTK_ADJUSTMENT (gtk_adjustment_new (max,
40 							    1, max,
41 							    1,
42 							    (max + 1) / 10,
43 							    0.0));
44 
45 		GtkWidget *spin = gtk_spin_button_new (adj, 1.0, 0);
46 		GtkWidget *hbox = gtk_hbox_new (FALSE, 2);
47 
48 		gtk_box_pack_start (GTK_BOX (hbox),
49 				    spin,
50 				    FALSE,
51 				    FALSE,
52 				    2);
53 
54 		gtk_container_add (GTK_CONTAINER (mainbox), hbox);
55 
56 	}
57 
58         gtk_widget_show_all (window);
59 
60         gtk_main ();
61 
62         return 0;
63 }
64