diff --git a/demos/testpixbuf-scale.c b/demos/testpixbuf-scale.c index 8051fa5edd..0d89f2e13e 100644 --- a/demos/testpixbuf-scale.c +++ b/demos/testpixbuf-scale.c @@ -123,7 +123,7 @@ main(int argc, char **argv) label = gtk_label_new ("Overall Alpha:"); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (overall_alpha, 0, 255, 1, 10, 0)); + adjustment = gtk_adjustment_new (overall_alpha, 0, 255, 1, 10, 0); g_signal_connect (adjustment, "value_changed", G_CALLBACK (overall_changed_cb), NULL); diff --git a/docs/reference/gtk/tmpl/gtkspinbutton.sgml b/docs/reference/gtk/tmpl/gtkspinbutton.sgml index 0ed732daf3..b6c899c5f3 100644 --- a/docs/reference/gtk/tmpl/gtkspinbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkspinbutton.sgml @@ -34,8 +34,8 @@ void create_integer_spin_button (void) { GtkWidget *window, *spinner; GtkAdjustment *spinner_adj; - spinner_adj = (GtkAdjustment *) gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 5.0); - + spinner_adj = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 5.0); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 5); @@ -69,8 +69,8 @@ void create_floating_spin_button (void) { GtkWidget *window, *spinner; GtkAdjustment *spinner_adj; - spinner_adj = (GtkAdjustment *) gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.1); - + spinner_adj = gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.1); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 5); diff --git a/examples/gtkdial/dial_test.c b/examples/gtkdial/dial_test.c index ccadb3d077..1afb41b152 100644 --- a/examples/gtkdial/dial_test.c +++ b/examples/gtkdial/dial_test.c @@ -43,7 +43,7 @@ int main( int argc, gtk_container_add (GTK_CONTAINER (vbox), frame); gtk_widget_show (frame); - adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0)); + adjustment = gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0); dial = gtk_dial_new (adjustment); gtk_dial_set_update_policy (GTK_DIAL (dial), GTK_UPDATE_DELAYED); diff --git a/examples/gtkdial/gtkdial.c b/examples/gtkdial/gtkdial.c index 31f51c040b..65fc3fb25b 100644 --- a/examples/gtkdial/gtkdial.c +++ b/examples/gtkdial/gtkdial.c @@ -129,7 +129,7 @@ gtk_dial_new (GtkAdjustment *adjustment) dial = g_object_new (gtk_dial_get_type (), NULL); if (!adjustment) - adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); gtk_dial_set_adjustment (dial, adjustment); diff --git a/examples/spinbutton/spinbutton.c b/examples/spinbutton/spinbutton.c index eff67ff823..a27e7e357d 100644 --- a/examples/spinbutton/spinbutton.c +++ b/examples/spinbutton/spinbutton.c @@ -92,8 +92,7 @@ int main( int argc, gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, - 5.0, 0.0); + adj = gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, 5.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); @@ -105,8 +104,7 @@ int main( int argc, gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, - 5.0, 0.0); + adj = gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); @@ -118,8 +116,7 @@ int main( int argc, gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (1998.0, 0.0, 2100.0, - 1.0, 100.0, 0.0); + adj = gtk_adjustment_new (1998.0, 0.0, 2100.0, 1.0, 100.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), FALSE); gtk_widget_set_size_request (spinner, 55, -1); @@ -142,8 +139,7 @@ int main( int argc, gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (0.0, -10000.0, 10000.0, - 0.5, 100.0, 0.0); + adj = gtk_adjustment_new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0); spinner1 = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE); gtk_widget_set_size_request (spinner1, 100, -1); @@ -156,7 +152,7 @@ int main( int argc, gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (2, 1, 5, 1, 1, 0); + adj = gtk_adjustment_new (2, 1, 5, 1, 1, 0); spinner2 = gtk_spin_button_new (adj, 0.0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner2), TRUE); g_signal_connect (adj, "value-changed", diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index ce808e73e7..7436d6adeb 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -432,7 +432,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel) priv->opacity_label = gtk_label_new_with_mnemonic (_("Op_acity:")); gtk_misc_set_alignment (GTK_MISC (priv->opacity_label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), priv->opacity_label, 0, 1, 4, 5); - adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0)); + adjust = gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0); g_object_set_data (G_OBJECT (adjust), I_("COLORSEL"), colorsel); priv->opacity_slider = gtk_hscale_new (adjust); gtk_widget_set_tooltip_text (priv->opacity_slider, @@ -2102,16 +2102,16 @@ make_label_spinbutton (GtkColorSelection *colorsel, if (channel_type == COLORSEL_HUE) { - adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 1.0, 0.0)); + adjust = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 1.0, 0.0); } else if (channel_type == COLORSEL_SATURATION || channel_type == COLORSEL_VALUE) { - adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 0.0)); + adjust = gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 0.0); } else { - adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0)); + adjust = gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0); } g_object_set_data (G_OBJECT (adjust), I_("COLORSEL"), colorsel); *spinbutton = gtk_spin_button_new (adjust, 10.0, 0); diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 88f983086d..f8f830ae02 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -2522,11 +2522,11 @@ gtk_icon_view_set_adjustments (GtkIconView *icon_view, if (hadj) g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); else - hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + hadj = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); if (vadj) g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); else - vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + vadj = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); if (icon_view->priv->hadjustment && (icon_view->priv->hadjustment != hadj)) { diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index 9a0943bdd0..b1a7e96abb 100644 --- a/gtk/gtklayout.c +++ b/gtk/gtklayout.c @@ -227,7 +227,7 @@ gtk_layout_get_vadjustment (GtkLayout *layout) static GtkAdjustment * new_default_adjustment (void) { - return GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + return gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); } static void diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index ee02d3b356..d0c033868f 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -2190,13 +2190,11 @@ gtk_menu_set_tearoff_state (GtkMenu *menu, gtk_container_add (GTK_CONTAINER (menu->tearoff_window), menu->tearoff_hbox); height = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET (menu))); - menu->tearoff_adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (0, - 0, - priv->requested_height, - MENU_SCROLL_STEP2, - height/2, - height)); + menu->tearoff_adjustment = gtk_adjustment_new (0, + 0, priv->requested_height, + MENU_SCROLL_STEP2, + height/2, + height); g_object_connect (menu->tearoff_adjustment, "signal::value-changed", gtk_menu_scrollbar_changed, menu, NULL); diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 07d89e1480..fd9ae0e175 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -822,7 +822,7 @@ gtk_range_set_adjustment (GtkRange *range, priv = range->priv; if (!adjustment) - adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); else g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 2de9de9e63..243873b4c4 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -411,7 +411,7 @@ gtk_scale_button_init (GtkScaleButton *button) G_CALLBACK (cb_button_release), button); gtk_box_pack_end (GTK_BOX (priv->box), priv->minus_button, FALSE, FALSE, 0); - priv->adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100.0, 2, 20, 0)); + priv->adjustment = gtk_adjustment_new (0.0, 0.0, 100.0, 2, 20, 0); g_object_ref_sink (priv->adjustment); /* the scale */ @@ -704,8 +704,9 @@ gtk_scale_button_set_adjustment (GtkScaleButton *button, GtkAdjustment *adjustment) { g_return_if_fail (GTK_IS_SCALE_BUTTON (button)); + if (!adjustment) - adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); else g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 62f5e6b8a7..dcda50ceca 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -422,7 +422,7 @@ gtk_spin_button_set_property (GObject *object, case PROP_ADJUSTMENT: adjustment = GTK_ADJUSTMENT (g_value_get_object (value)); if (!adjustment) - adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); gtk_spin_button_set_adjustment (spin_button, adjustment); break; case PROP_CLIMB_RATE: @@ -526,7 +526,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) priv->snap_to_ticks = FALSE; gtk_spin_button_set_adjustment (spin_button, - (GtkAdjustment*) gtk_adjustment_new (0, 0, 0, 0, 0, 0)); + gtk_adjustment_new (0, 0, 0, 0, 0, 0)); } static void diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index a09dbc4678..73bb5e1a24 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -7408,11 +7408,11 @@ gtk_text_view_set_scroll_adjustments (GtkTextView *text_view, if (hadj) g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); else - hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + hadj = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); if (vadj) g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); else - vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + vadj = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); if (priv->hadjustment && (priv->hadjustment != hadj)) { diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 2923fe9eac..3f447b14a2 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -8090,11 +8090,11 @@ gtk_tree_view_set_adjustments (GtkTreeView *tree_view, if (hadj) g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); else - hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + hadj = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); if (vadj) g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); else - vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + vadj = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); if (tree_view->priv->hadjustment && (tree_view->priv->hadjustment != hadj)) { diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 546ec1e501..7f24b54ace 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -509,8 +509,7 @@ viewport_set_adjustment (GtkViewport *viewport, return; if (!adjustment) - adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, - 0.0, 0.0, 0.0)); + adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); viewport_disconnect_adjustment (viewport, orientation); *adjustmentp = adjustment; g_object_ref_sink (adjustment); diff --git a/tests/prop-editor.c b/tests/prop-editor.c index 9117d60f3e..bc99f655ba 100644 --- a/tests/prop-editor.c +++ b/tests/prop-editor.c @@ -715,14 +715,13 @@ property_widget (GObject *object, if (type == G_TYPE_PARAM_INT) { - adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_INT (spec)->default_value, - G_PARAM_SPEC_INT (spec)->minimum, - G_PARAM_SPEC_INT (spec)->maximum, - 1, - MAX ((G_PARAM_SPEC_INT (spec)->maximum - - G_PARAM_SPEC_INT (spec)->minimum) / 10, 1), - 0.0)); - + adj = gtk_adjustment_new (G_PARAM_SPEC_INT (spec)->default_value, + G_PARAM_SPEC_INT (spec)->minimum, + G_PARAM_SPEC_INT (spec)->maximum, + 1, + MAX ((G_PARAM_SPEC_INT (spec)->maximum - G_PARAM_SPEC_INT (spec)->minimum) / 10, 1), + 0.0); + prop_edit = gtk_spin_button_new (adj, 1.0, 0); g_object_connect_property (object, spec, @@ -735,15 +734,13 @@ property_widget (GObject *object, } else if (type == G_TYPE_PARAM_UINT) { - adj = GTK_ADJUSTMENT ( - gtk_adjustment_new (G_PARAM_SPEC_UINT (spec)->default_value, - G_PARAM_SPEC_UINT (spec)->minimum, - G_PARAM_SPEC_UINT (spec)->maximum, - 1, - MAX ((G_PARAM_SPEC_UINT (spec)->maximum - - G_PARAM_SPEC_UINT (spec)->minimum) / 10, 1), - 0.0)); - + adj = gtk_adjustment_new (G_PARAM_SPEC_UINT (spec)->default_value, + G_PARAM_SPEC_UINT (spec)->minimum, + G_PARAM_SPEC_UINT (spec)->maximum, + 1, + MAX ((G_PARAM_SPEC_UINT (spec)->maximum - G_PARAM_SPEC_UINT (spec)->minimum) / 10, 1), + 0.0); + prop_edit = gtk_spin_button_new (adj, 1.0, 0); g_object_connect_property (object, spec, @@ -756,15 +753,13 @@ property_widget (GObject *object, } else if (type == G_TYPE_PARAM_FLOAT) { + adj = gtk_adjustment_new (G_PARAM_SPEC_FLOAT (spec)->default_value, + G_PARAM_SPEC_FLOAT (spec)->minimum, + G_PARAM_SPEC_FLOAT (spec)->maximum, + 0.1, + MAX ((G_PARAM_SPEC_FLOAT (spec)->maximum - G_PARAM_SPEC_FLOAT (spec)->minimum) / 10, 0.1), + 0.0); - adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_FLOAT (spec)->default_value, - G_PARAM_SPEC_FLOAT (spec)->minimum, - G_PARAM_SPEC_FLOAT (spec)->maximum, - 0.1, - MAX ((G_PARAM_SPEC_FLOAT (spec)->maximum - - G_PARAM_SPEC_FLOAT (spec)->minimum) / 10, 0.1), - 0.0)); - prop_edit = gtk_spin_button_new (adj, 0.1, 2); g_object_connect_property (object, spec, @@ -777,14 +772,13 @@ property_widget (GObject *object, } else if (type == G_TYPE_PARAM_DOUBLE) { - adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_DOUBLE (spec)->default_value, - G_PARAM_SPEC_DOUBLE (spec)->minimum, - G_PARAM_SPEC_DOUBLE (spec)->maximum, - 0.1, - MAX ((G_PARAM_SPEC_DOUBLE (spec)->maximum - - G_PARAM_SPEC_DOUBLE (spec)->minimum) / 10, 0.1), - 0.0)); - + adj = gtk_adjustment_new (G_PARAM_SPEC_DOUBLE (spec)->default_value, + G_PARAM_SPEC_DOUBLE (spec)->minimum, + G_PARAM_SPEC_DOUBLE (spec)->maximum, + 0.1, + MAX ((G_PARAM_SPEC_DOUBLE (spec)->maximum - G_PARAM_SPEC_DOUBLE (spec)->minimum) / 10, 0.1), + 0.0); + prop_edit = gtk_spin_button_new (adj, 0.1, 2); g_object_connect_property (object, spec, diff --git a/tests/testgtk.c b/tests/testgtk.c index fd553bbd69..d67e62372b 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -608,12 +608,12 @@ create_big_windows (GtkWidget *widget) darea = gtk_drawing_area_new (); - hadj = (GtkAdjustment *)gtk_adjustment_new (0, 0, PATTERN_SIZE, 10, 100, 100); + hadj = gtk_adjustment_new (0, 0, PATTERN_SIZE, 10, 100, 100); g_signal_connect (hadj, "value_changed", G_CALLBACK (pattern_hadj_changed), darea); g_object_set_data (G_OBJECT (hadj), "old-value", ¤t_x); - - vadj = (GtkAdjustment *)gtk_adjustment_new (0, 0, PATTERN_SIZE, 10, 100, 100); + + vadj = gtk_adjustment_new (0, 0, PATTERN_SIZE, 10, 100, 100); g_signal_connect (vadj, "value_changed", G_CALLBACK (pattern_vadj_changed), darea); g_object_set_data (G_OBJECT (vadj), "old-value", ¤t_y); @@ -4779,8 +4779,8 @@ create_spins (GtkWidget *widget) label = gtk_label_new ("Time :"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (0, 0, 1410, 30, 60, 0); + + adj = gtk_adjustment_new (0, 0, 1410, 30, 60, 0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_editable_set_editable (GTK_EDITABLE (spinner), FALSE); g_signal_connect (spinner, @@ -4797,8 +4797,8 @@ create_spins (GtkWidget *widget) label = gtk_label_new ("Month :"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, + + adj = gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (spinner), @@ -4822,7 +4822,7 @@ create_spins (GtkWidget *widget) gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (0, 0, 255, 1, 16, 0); + adj = gtk_adjustment_new (0, 0, 255, 1, 16, 0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_editable_set_editable (GTK_EDITABLE (spinner), TRUE); g_signal_connect (spinner, @@ -4854,7 +4854,7 @@ create_spins (GtkWidget *widget) gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (0.0, -10000.0, 10000.0, + adj = gtk_adjustment_new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0); spinner1 = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE); @@ -4867,7 +4867,7 @@ create_spins (GtkWidget *widget) gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - adj = (GtkAdjustment *) gtk_adjustment_new (2, 1, 15, 1, 1, 0); + adj = gtk_adjustment_new (2, 1, 15, 1, 1, 0); spinner2 = gtk_spin_button_new (adj, 0.0, 0); g_signal_connect (adj, "value_changed", G_CALLBACK (change_digits), @@ -5121,11 +5121,11 @@ create_cursors (GtkWidget *widget) label = gtk_label_new ("Cursor Value : "); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (0, - 0, 152, - 2, - 10, 0); + + adj = gtk_adjustment_new (0, + 0, 152, + 2, + 10, 0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_box_pack_start (GTK_BOX (hbox), spinner, TRUE, TRUE, 0); @@ -8145,16 +8145,14 @@ window_controls (GtkWidget *window) G_CALLBACK (configure_event_callback), label); - adj = (GtkAdjustment *) gtk_adjustment_new (10.0, -2000.0, 2000.0, 1.0, - 5.0, 0.0); + adj = gtk_adjustment_new (10.0, -2000.0, 2000.0, 1.0, 5.0, 0.0); spin = gtk_spin_button_new (adj, 0, 0); gtk_box_pack_start (GTK_BOX (vbox), spin, FALSE, FALSE, 0); g_object_set_data (G_OBJECT (control_window), "spin1", spin); - adj = (GtkAdjustment *) gtk_adjustment_new (10.0, -2000.0, 2000.0, 1.0, - 5.0, 0.0); + adj = gtk_adjustment_new (10.0, -2000.0, 2000.0, 1.0, 5.0, 0.0); spin = gtk_spin_button_new (adj, 0, 0); gtk_box_pack_start (GTK_BOX (vbox), spin, FALSE, FALSE, 0); @@ -9200,7 +9198,7 @@ create_scroll_test (GtkWidget *widget) gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_SCROLL_MASK); - adj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1000.0, 1.0, 180.0, 200.0)); + adj = gtk_adjustment_new (0.0, 0.0, 1000.0, 1.0, 180.0, 200.0); scroll_test_pos = 0.0; scrollbar = gtk_vscrollbar_new (adj); diff --git a/tests/testspinbutton.c b/tests/testspinbutton.c index a82f0e16f5..d77c69542c 100644 --- a/tests/testspinbutton.c +++ b/tests/testspinbutton.c @@ -35,13 +35,12 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (window), mainbox); for (max = 9; max <= 999999999; max = max * 10 + 9) { - GtkAdjustment *adj = - GTK_ADJUSTMENT (gtk_adjustment_new (max, - 1, max, - 1, - (max + 1) / 10, - 0.0)); - + GtkAdjustment *adj = gtk_adjustment_new (max, + 1, max, + 1, + (max + 1) / 10, + 0.0); + GtkWidget *spin = gtk_spin_button_new (adj, 1.0, 0); GtkWidget *hbox = gtk_hbox_new (FALSE, 2);