testgtk: GtkSpinButton is not a GtkEntry anymore
authorTimm Bäder <mail@baedert.org>
Sat, 17 Mar 2018 10:20:49 +0000 (11:20 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 17 Mar 2018 11:09:30 +0000 (12:09 +0100)
tests/testgtk.c

index 65d9b2cabfa5e79491eb4fb5627ffc1920a535c0..bc952a0e72a9e3a2153fc3c8affd1090c4605935 100644 (file)
@@ -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");