]> Pileus Git - ~andy/gtk/blob - tests/testspinbutton.c
gtk: remove "gboolean homogeneous" from gtk_box_new()
[~andy/gtk] / tests / testspinbutton.c
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
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_box_new (GTK_ORIENTATION_VERTICAL, 2);
35         gtk_container_add (GTK_CONTAINER (window), mainbox);
36
37         for (max = 9; max <= 999999999; max = max * 10 + 9) {
38                 GtkAdjustment *adj = gtk_adjustment_new (max,
39                                                          1, max,
40                                                          1,
41                                                          (max + 1) / 10,
42                                                          0.0);
43
44                 GtkWidget *spin = gtk_spin_button_new (adj, 1.0, 0);
45                 GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
46
47                 gtk_box_pack_start (GTK_BOX (hbox),
48                                     spin,
49                                     FALSE,
50                                     FALSE,
51                                     2);
52
53                 gtk_container_add (GTK_CONTAINER (mainbox), hbox);
54
55         }
56
57         gtk_widget_show_all (window);
58
59         gtk_main ();
60
61         return 0;
62 }