From: Timm Bäder Date: Sat, 17 Mar 2018 10:20:49 +0000 (+0100) Subject: testgtk: GtkSpinButton is not a GtkEntry anymore X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~22^2~912 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=004d0f2fc1299a1222834e89b25b9b2eebb6ef12;p=gtk4.git testgtk: GtkSpinButton is not a GtkEntry anymore --- diff --git a/tests/testgtk.c b/tests/testgtk.c index 65d9b2cabf..bc952a0e72 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -3306,8 +3306,8 @@ spin_button_time_output_func (GtkSpinButton *spin_button) hours = gtk_adjustment_get_value (adjustment) / 60.0; minutes = (fabs(floor (hours) - hours) < 1e-5) ? 0.0 : 30; sprintf (buf, "%02.0f:%02.0f", floor (hours), minutes); - if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin_button)))) - gtk_entry_set_text (GTK_ENTRY (spin_button), buf); + if (strcmp (buf, gtk_spin_button_get_text (spin_button))) + gtk_spin_button_set_text (spin_button, buf); return TRUE; } @@ -3325,7 +3325,7 @@ spin_button_month_input_func (GtkSpinButton *spin_button, for (i = 1; i <= 12; i++) { tmp1 = g_ascii_strup (month[i - 1], -1); - tmp2 = g_ascii_strup (gtk_entry_get_text (GTK_ENTRY (spin_button)), -1); + tmp2 = g_ascii_strup (gtk_spin_button_get_text (spin_button), -1); if (strstr (tmp1, tmp2) == tmp1) found = TRUE; g_free (tmp1); @@ -3357,8 +3357,8 @@ spin_button_month_output_func (GtkSpinButton *spin_button) for (i = 1; i <= 12; i++) if (fabs (value - (double)i) < 1e-5) { - if (strcmp (month[i-1], gtk_entry_get_text (GTK_ENTRY (spin_button)))) - gtk_entry_set_text (GTK_ENTRY (spin_button), month[i-1]); + if (strcmp (month[i-1], gtk_spin_button_get_text (spin_button))) + gtk_spin_button_set_text (spin_button, month[i-1]); } return TRUE; } @@ -3371,7 +3371,7 @@ spin_button_hex_input_func (GtkSpinButton *spin_button, gchar *err; gdouble res; - buf = gtk_entry_get_text (GTK_ENTRY (spin_button)); + buf = gtk_spin_button_get_text (GTK_SPIN_BUTTON (spin_button)); res = strtol(buf, &err, 16); *new_val = res; if (*err) @@ -3393,8 +3393,9 @@ spin_button_hex_output_func (GtkSpinButton *spin_button) sprintf (buf, "0x00"); else sprintf (buf, "0x%.2X", val); - if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin_button)))) - gtk_entry_set_text (GTK_ENTRY (spin_button), buf); + if (strcmp (buf, gtk_spin_button_get_text (spin_button))) + gtk_spin_button_set_text (spin_button, buf); + return TRUE; } @@ -3456,7 +3457,7 @@ create_spins (GtkWidget *widget) G_CALLBACK (spin_button_time_output_func), NULL); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); - gtk_entry_set_width_chars (GTK_ENTRY (spinner), 5); + gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 5); gtk_box_pack_start (GTK_BOX (vbox2), spinner); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); @@ -3481,7 +3482,7 @@ create_spins (GtkWidget *widget) G_CALLBACK (spin_button_month_output_func), NULL); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); - gtk_entry_set_width_chars (GTK_ENTRY (spinner), 9); + gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 9); gtk_box_pack_start (GTK_BOX (vbox2), spinner); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); @@ -3504,7 +3505,7 @@ create_spins (GtkWidget *widget) G_CALLBACK (spin_button_hex_output_func), NULL); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); - gtk_entry_set_width_chars (GTK_ENTRY (spinner), 4); + gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 4); gtk_box_pack_start (GTK_BOX (vbox2), spinner); frame = gtk_frame_new ("Accelerated");