[gtk/wip/baedert/for-master: 20/29] Clean up uses of gtk_toggle_button_get/set_active




commit 2c5c938f0d2bfdc60d351142eb4afa97d055986c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 30 19:36:27 2020 -0400

    Clean up uses of gtk_toggle_button_get/set_active
    
    Replace all uses on check buttons by the corresponding
    check button api.

 demos/gtk-demo/font_features.c         | 14 ++++++-------
 demos/gtk-demo/fontrendering.c         |  8 ++++----
 demos/gtk-demo/listbox2.c              |  4 ++--
 demos/gtk-demo/panes.c                 |  6 +++---
 demos/gtk-demo/sizegroup.c             |  2 +-
 demos/node-editor/node-editor-window.c |  2 +-
 examples/plugman.c                     |  4 ++--
 gtk/gtkfilechooserwidget.c             |  8 ++++----
 gtk/gtkpagesetupunixdialog.c           | 16 +++++++--------
 gtk/gtkprintbackend.c                  |  5 ++---
 gtk/gtkprinteroptionwidget.c           |  4 ++--
 gtk/gtkwindow.c                        |  2 +-
 gtk/inspector/logs.c                   |  4 ++--
 gtk/inspector/prop-editor.c            |  2 +-
 gtk/ui/gtkpagesetupunixdialog.ui       |  8 ++++----
 tests/testcalendar.c                   |  4 ++--
 tests/testcellarea.c                   | 36 +++++++++++++++++-----------------
 tests/testinhibitshortcuts.c           |  6 +++---
 tests/testlist.c                       |  6 +++---
 tests/testlockbutton.c                 | 14 ++++++-------
 tests/testpopover.c                    |  2 +-
 tests/testselectionmode.c              |  4 ++--
 tests/teststack.c                      | 12 ++++++------
 tests/testtreeedit.c                   |  2 +-
 tests/testwindowsize.c                 |  2 +-
 25 files changed, 88 insertions(+), 89 deletions(-)
---
diff --git a/demos/gtk-demo/font_features.c b/demos/gtk-demo/font_features.c
index e75e02c6fc..a8d0a5d68b 100644
--- a/demos/gtk-demo/font_features.c
+++ b/demos/gtk-demo/font_features.c
@@ -1166,15 +1166,15 @@ font_features_reset_features (void)
     {
       FeatureItem *item = l->data;
 
-      if (GTK_IS_RADIO_BUTTON (item->feat))
+      if (GTK_IS_CHECK_BUTTON (item->feat))
         {
           if (strcmp (item->name, "xxxx") == 0)
-            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->feat), TRUE);
-        }
-      else if (GTK_IS_CHECK_BUTTON (item->feat))
-        {
-          gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->feat), FALSE);
-          set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE);
+            gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE);
+          else
+            {
+              gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), FALSE);
+              set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE);
+            }
         }
     }
 }
diff --git a/demos/gtk-demo/fontrendering.c b/demos/gtk-demo/fontrendering.c
index 44a628e786..cc1d9033bb 100644
--- a/demos/gtk-demo/fontrendering.c
+++ b/demos/gtk-demo/fontrendering.c
@@ -59,7 +59,7 @@ update_image (void)
     hintstyle = CAIRO_HINT_STYLE_DEFAULT;
   cairo_font_options_set_hint_style (fopt, hintstyle);
 
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hint_metrics)))
+  if (gtk_check_button_get_active (GTK_CHECK_BUTTON (hint_metrics)))
     hintmetrics = CAIRO_HINT_METRICS_ON;
   else
     hintmetrics = CAIRO_HINT_METRICS_OFF;
@@ -69,7 +69,7 @@ update_image (void)
   cairo_font_options_destroy (fopt);
   pango_context_changed (context);
 
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (text_radio)))
+  if (gtk_check_button_get_active (GTK_CHECK_BUTTON (text_radio)))
     {
       layout = pango_layout_new (context);
       pango_layout_set_font_description (layout, desc);
@@ -107,7 +107,7 @@ update_image (void)
       cr = cairo_create (surface);
       cairo_set_line_width (cr, 1);
 
-      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (show_grid)))
+      if (gtk_check_button_get_active (GTK_CHECK_BUTTON (show_grid)))
         {
           int i;
           cairo_set_source_rgba (cr, 0.2, 0, 0, 0.2);
@@ -125,7 +125,7 @@ update_image (void)
             }
         }
 
-      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (show_extents)))
+      if (gtk_check_button_get_active (GTK_CHECK_BUTTON (show_extents)))
         {
           cairo_set_source_rgba (cr, 0, 0, 1, 1);
 
diff --git a/demos/gtk-demo/listbox2.c b/demos/gtk-demo/listbox2.c
index 6b4aae0009..17a79df741 100644
--- a/demos/gtk-demo/listbox2.c
+++ b/demos/gtk-demo/listbox2.c
@@ -23,8 +23,8 @@ row_activated (GtkListBox    *list,
     }
   else if (gtk_widget_is_ancestor (check, GTK_WIDGET (row)))
     {
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                    !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (check),
+                                   !gtk_check_button_get_active (GTK_CHECK_BUTTON (check)));
     }
   else if (gtk_widget_is_ancestor (image, GTK_WIDGET (row)))
     {
diff --git a/demos/gtk-demo/panes.c b/demos/gtk-demo/panes.c
index e6312054f1..9879d30bfa 100644
--- a/demos/gtk-demo/panes.c
+++ b/demos/gtk-demo/panes.c
@@ -75,7 +75,7 @@ create_pane_options (GtkPaned    *paned,
 
   check_button = gtk_check_button_new_with_mnemonic ("_Shrink");
   gtk_grid_attach (GTK_GRID (table), check_button, 0, 2, 1, 1);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (check_button), TRUE);
   g_signal_connect (check_button, "toggled",
                     G_CALLBACK (toggle_shrink), child1);
 
@@ -84,13 +84,13 @@ create_pane_options (GtkPaned    *paned,
 
   check_button = gtk_check_button_new_with_mnemonic ("_Resize");
   gtk_grid_attach (GTK_GRID (table), check_button, 1, 1, 1, 1);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (check_button), TRUE);
   g_signal_connect (check_button, "toggled",
                     G_CALLBACK (toggle_resize), child2);
 
   check_button = gtk_check_button_new_with_mnemonic ("_Shrink");
   gtk_grid_attach (GTK_GRID (table), check_button, 1, 2, 1, 1);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (check_button), TRUE);
   g_signal_connect (check_button, "toggled",
                     G_CALLBACK (toggle_shrink), child2);
 
diff --git a/demos/gtk-demo/sizegroup.c b/demos/gtk-demo/sizegroup.c
index a3e3547b8b..db8f16e105 100644
--- a/demos/gtk-demo/sizegroup.c
+++ b/demos/gtk-demo/sizegroup.c
@@ -152,7 +152,7 @@ do_sizegroup (GtkWidget *do_widget)
       check_button = gtk_check_button_new_with_mnemonic ("_Enable grouping");
       gtk_box_append (GTK_BOX (vbox), check_button);
 
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (check_button), TRUE);
       g_signal_connect (check_button, "toggled",
                         G_CALLBACK (toggle_grouping), size_group);
     }
diff --git a/demos/node-editor/node-editor-window.c b/demos/node-editor/node-editor-window.c
index 1e88395385..f67331b323 100644
--- a/demos/node-editor/node-editor-window.c
+++ b/demos/node-editor/node-editor-window.c
@@ -667,7 +667,7 @@ testcase_save_clicked_cb (GtkWidget        *button,
   png_file = g_build_filename (source_dir, png_file_name, NULL);
   g_free (png_file_name);
 
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->testcase_cairo_checkbutton)))
+  if (gtk_check_button_get_active (GTK_CHECK_BUTTON (self->testcase_cairo_checkbutton)))
     texture = create_cairo_texture (self);
   else
     texture = create_texture (self);
diff --git a/examples/plugman.c b/examples/plugman.c
index d6962c6ce5..da91f9de99 100644
--- a/examples/plugman.c
+++ b/examples/plugman.c
@@ -378,10 +378,10 @@ configure_plugins (GSimpleAction *action,
 
   dialog = (GtkWidget *)gtk_builder_get_object (builder, "plugin-dialog");
   check = (GtkWidget *)gtk_builder_get_object (builder, "red-plugin");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), plugin_enabled ("red"));
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (check), plugin_enabled ("red"));
   g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), (char *) "red");
   check = (GtkWidget *)gtk_builder_get_object (builder, "black-plugin");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), plugin_enabled ("black"));
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (check), plugin_enabled ("black"));
   g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), (char *) "black");
 
   g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index ec30098d72..12d7a14001 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -8001,8 +8001,8 @@ gtk_file_chooser_widget_set_choice (GtkFileChooser  *chooser,
             }
         }
     }
-  else if (GTK_IS_TOGGLE_BUTTON (widget))
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), g_str_equal (option, "true"));
+  else if (GTK_IS_CHECK_BUTTON (widget))
+    gtk_check_button_set_active (GTK_CHECK_BUTTON (widget), g_str_equal (option, "true"));
 }
 
 static const char *
@@ -8024,8 +8024,8 @@ gtk_file_chooser_widget_get_choice (GtkFileChooser  *chooser,
       return NULL;
     }
 
-  else if (GTK_IS_TOGGLE_BUTTON (widget))
-    return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? "true" : "false";
+  else if (GTK_IS_CHECK_BUTTON (widget))
+    return gtk_check_button_get_active (GTK_CHECK_BUTTON (widget)) ? "true" : "false";
 
   return NULL;
 }
diff --git a/gtk/gtkpagesetupunixdialog.c b/gtk/gtkpagesetupunixdialog.c
index 6bc99f6519..82fb4c1d94 100644
--- a/gtk/gtkpagesetupunixdialog.c
+++ b/gtk/gtkpagesetupunixdialog.c
@@ -26,7 +26,7 @@
 
 #include "gtkbutton.h"
 #include "gtkscrolledwindow.h"
-#include "gtktogglebutton.h"
+#include "gtkcheckbutton.h"
 #include "gtklabel.h"
 #include "gtkgrid.h"
 #include "gtkcelllayout.h"
@@ -779,11 +779,11 @@ gtk_page_setup_unix_dialog_new (const char *title,
 static GtkPageOrientation
 get_orientation (GtkPageSetupUnixDialog *dialog)
 {
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->portrait_radio)))
+  if (gtk_check_button_get_active (GTK_CHECK_BUTTON (dialog->portrait_radio)))
     return GTK_PAGE_ORIENTATION_PORTRAIT;
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->landscape_radio)))
+  if (gtk_check_button_get_active (GTK_CHECK_BUTTON (dialog->landscape_radio)))
     return GTK_PAGE_ORIENTATION_LANDSCAPE;
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->reverse_landscape_radio)))
+  if (gtk_check_button_get_active (GTK_CHECK_BUTTON (dialog->reverse_landscape_radio)))
     return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE;
   return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT;
 }
@@ -795,16 +795,16 @@ set_orientation (GtkPageSetupUnixDialog *dialog,
   switch (orientation)
     {
     case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->reverse_portrait_radio), TRUE);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (dialog->reverse_portrait_radio), TRUE);
       break;
     case GTK_PAGE_ORIENTATION_PORTRAIT:
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->portrait_radio), TRUE);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (dialog->portrait_radio), TRUE);
       break;
     case GTK_PAGE_ORIENTATION_LANDSCAPE:
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->landscape_radio), TRUE);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (dialog->landscape_radio), TRUE);
       break;
     case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->reverse_landscape_radio), TRUE);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (dialog->reverse_landscape_radio), TRUE);
       break;
     default:
       break;
diff --git a/gtk/gtkprintbackend.c b/gtk/gtkprintbackend.c
index 5cab6e6998..63894df2d2 100644
--- a/gtk/gtkprintbackend.c
+++ b/gtk/gtkprintbackend.c
@@ -562,7 +562,7 @@ store_auth_info_toggled (GtkCheckButton *chkbtn,
                          gpointer        user_data)
 {
   gboolean *data = (gboolean *) user_data;
-  *data = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chkbtn));
+  *data = gtk_check_button_get_active (GTK_CHECK_BUTTON (chkbtn));
 }
 
 static void
@@ -670,7 +670,6 @@ request_password (GtkPrintBackend  *backend,
   gtk_widget_set_size_request (GTK_WIDGET (label), 320, -1);
   g_free (markup);
 
-
   /* Packing */
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
   gtk_box_append (GTK_BOX (content_area), main_box);
@@ -719,7 +718,7 @@ request_password (GtkPrintBackend  *backend,
       chkbtn = gtk_check_button_new_with_mnemonic (_("_Remember password"));
       gtk_widget_set_margin_top (chkbtn, 6);
       gtk_widget_set_margin_bottom (chkbtn, 6);
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chkbtn), FALSE);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (chkbtn), FALSE);
       gtk_box_append (GTK_BOX (vbox), chkbtn);
       g_signal_connect (chkbtn, "toggled",
                         G_CALLBACK (store_auth_info_toggled),
diff --git a/gtk/gtkprinteroptionwidget.c b/gtk/gtkprinteroptionwidget.c
index 5165ff69a0..9d8aefa480 100644
--- a/gtk/gtkprinteroptionwidget.c
+++ b/gtk/gtkprinteroptionwidget.c
@@ -1123,9 +1123,9 @@ update_widgets (GtkPrinterOptionWidget *widget)
     {
     case GTK_PRINTER_OPTION_TYPE_BOOLEAN:
       if (g_ascii_strcasecmp (source->value, "True") == 0)
-       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check), TRUE);
+       gtk_check_button_set_active (GTK_CHECK_BUTTON (priv->check), TRUE);
       else
-       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->check), FALSE);
+       gtk_check_button_set_active (GTK_CHECK_BUTTON (priv->check), FALSE);
       break;
     case GTK_PRINTER_OPTION_TYPE_PICKONE:
       combo_box_set (priv->combo, source->value);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 235480b7c7..40673a037c 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6591,7 +6591,7 @@ warn_response (GtkDialog *dialog,
   display = gtk_inspector_window_get_inspected_display (GTK_INSPECTOR_WINDOW (inspector_window));
 
   check = g_object_get_data (G_OBJECT (dialog), "check");
-  remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));
+  remember = gtk_check_button_get_active (GTK_CHECK_BUTTON (check));
 
   gtk_window_destroy (GTK_WINDOW (dialog));
   g_object_set_data (G_OBJECT (inspector_window), "warning_dialog", NULL);
diff --git a/gtk/inspector/logs.c b/gtk/inspector/logs.c
index 59bc1a4ca7..b8f22b9504 100644
--- a/gtk/inspector/logs.c
+++ b/gtk/inspector/logs.c
@@ -29,7 +29,7 @@
 #include "gtktextview.h"
 #include "gtkmessagedialog.h"
 #include "gtkfilechooserdialog.h"
-#include "gtktogglebutton.h"
+#include "gtkcheckbutton.h"
 #include "gtklabel.h"
 #include "gtktooltip.h"
 #include "gtktextiter.h"
@@ -112,7 +112,7 @@ update_flag (GtkWidget *widget,
              guint     *flags,
              guint      flag)
 {
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+  if (gtk_check_button_get_active (GTK_CHECK_BUTTON (widget)))
     *flags = *flags | flag;
   else
     *flags = *flags & ~flag;
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index 28faa68272..ee84b1956f 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -498,7 +498,7 @@ flags_modified (GtkCheckButton *button, ObjectProperty *p)
   int i;
   GValue val = G_VALUE_INIT;
 
-  active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+  active = gtk_check_button_get_active (button);
   i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "index"));
   fclass = G_FLAGS_CLASS (g_type_class_peek (p->spec->value_type));
 
diff --git a/gtk/ui/gtkpagesetupunixdialog.ui b/gtk/ui/gtkpagesetupunixdialog.ui
index 9d3aae94a8..c35e73eaf0 100644
--- a/gtk/ui/gtkpagesetupunixdialog.ui
+++ b/gtk/ui/gtkpagesetupunixdialog.ui
@@ -93,7 +93,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioButton" id="portrait_radio">
+              <object class="GtkCheckButton" id="portrait_radio">
                 <property name="hexpand">1</property>
                 <property name="active">1</property>
                 <child>
@@ -118,7 +118,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioButton" id="reverse_portrait_radio">
+              <object class="GtkCheckButton" id="reverse_portrait_radio">
                 <property name="hexpand">1</property>
                 <property name="active">1</property>
                 <property name="group">portrait_radio</property>
@@ -144,7 +144,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioButton" id="landscape_radio">
+              <object class="GtkCheckButton" id="landscape_radio">
                 <property name="hexpand">1</property>
                 <property name="active">1</property>
                 <property name="group">portrait_radio</property>
@@ -170,7 +170,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioButton" id="reverse_landscape_radio">
+              <object class="GtkCheckButton" id="reverse_landscape_radio">
                 <property name="hexpand">1</property>
                 <property name="group">portrait_radio</property>
                 <child>
diff --git a/tests/testcalendar.c b/tests/testcalendar.c
index d9f5722b1c..387731d5a9 100644
--- a/tests/testcalendar.c
+++ b/tests/testcalendar.c
@@ -134,7 +134,7 @@ flag_toggled_cb (GtkCheckButton *button,
   } *data = user_data;
 
   g_object_set (G_OBJECT (data->calendar), data->prop_name,
-                gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)),
+                gtk_check_button_get_active (GTK_CHECK_BUTTON (button)),
                 NULL);
 }
 
@@ -255,7 +255,7 @@ create_calendar(void)
       gtk_box_append (GTK_BOX (vbox), toggle);
 
       g_object_get (G_OBJECT (calendar), flags[i].prop_name, &value, NULL);
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), value);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (toggle), value);
 
       g_signal_connect (toggle, "toggled", G_CALLBACK (flag_toggled_cb), &flags[i]);
     }
diff --git a/tests/testcellarea.c b/tests/testcellarea.c
index 7fdc444ac5..4e08983cea 100644
--- a/tests/testcellarea.c
+++ b/tests/testcellarea.c
@@ -124,51 +124,51 @@ orientation_changed (GtkComboBox      *combo,
 }
 
 static void
-align_cell_2_toggled (GtkToggleButton  *toggle,
+align_cell_2_toggled (GtkCheckButton  *toggle,
                      GtkIconView *iconview)
 {
   GtkCellArea *area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (iconview));
-  gboolean     align = gtk_toggle_button_get_active (toggle);
+  gboolean     align = gtk_check_button_get_active (toggle);
 
   gtk_cell_area_cell_set (area, cell_2, "align", align, NULL);
 }
 
 static void
-align_cell_3_toggled (GtkToggleButton  *toggle,
+align_cell_3_toggled (GtkCheckButton  *toggle,
                      GtkIconView *iconview)
 {
   GtkCellArea *area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (iconview));
-  gboolean     align = gtk_toggle_button_get_active (toggle);
+  gboolean     align = gtk_check_button_get_active (toggle);
 
   gtk_cell_area_cell_set (area, cell_3, "align", align, NULL);
 }
 
 static void
-expand_cell_1_toggled (GtkToggleButton  *toggle,
+expand_cell_1_toggled (GtkCheckButton  *toggle,
                       GtkIconView *iconview)
 {
   GtkCellArea *area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (iconview));
-  gboolean     expand = gtk_toggle_button_get_active (toggle);
+  gboolean     expand = gtk_check_button_get_active (toggle);
 
   gtk_cell_area_cell_set (area, cell_1, "expand", expand, NULL);
 }
 
 static void
-expand_cell_2_toggled (GtkToggleButton  *toggle,
+expand_cell_2_toggled (GtkCheckButton  *toggle,
                       GtkIconView *iconview)
 {
   GtkCellArea *area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (iconview));
-  gboolean     expand = gtk_toggle_button_get_active (toggle);
+  gboolean     expand = gtk_check_button_get_active (toggle);
 
   gtk_cell_area_cell_set (area, cell_2, "expand", expand, NULL);
 }
 
 static void
-expand_cell_3_toggled (GtkToggleButton  *toggle,
+expand_cell_3_toggled (GtkCheckButton  *toggle,
                       GtkIconView *iconview)
 {
   GtkCellArea *area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (iconview));
-  gboolean     expand = gtk_toggle_button_get_active (toggle);
+  gboolean     expand = gtk_check_button_get_active (toggle);
 
   gtk_cell_area_cell_set (area, cell_3, "expand", expand, NULL);
 }
@@ -210,14 +210,14 @@ simple_cell_area (void)
                     G_CALLBACK (orientation_changed), iconview);
 
   widget = gtk_check_button_new_with_label ("Align 2nd Cell");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (widget), FALSE);
   gtk_box_append (GTK_BOX (vbox), widget);
 
   g_signal_connect (G_OBJECT (widget), "toggled",
                     G_CALLBACK (align_cell_2_toggled), iconview);
 
   widget = gtk_check_button_new_with_label ("Align 3rd Cell");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (widget), TRUE);
   gtk_box_append (GTK_BOX (vbox), widget);
 
   g_signal_connect (G_OBJECT (widget), "toggled",
@@ -225,21 +225,21 @@ simple_cell_area (void)
 
 
   widget = gtk_check_button_new_with_label ("Expand 1st Cell");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (widget), FALSE);
   gtk_box_append (GTK_BOX (vbox), widget);
 
   g_signal_connect (G_OBJECT (widget), "toggled",
                     G_CALLBACK (expand_cell_1_toggled), iconview);
 
   widget = gtk_check_button_new_with_label ("Expand 2nd Cell");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (widget), TRUE);
   gtk_box_append (GTK_BOX (vbox), widget);
 
   g_signal_connect (G_OBJECT (widget), "toggled",
                     G_CALLBACK (expand_cell_2_toggled), iconview);
 
   widget = gtk_check_button_new_with_label ("Expand 3rd Cell");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (widget), FALSE);
   gtk_box_append (GTK_BOX (vbox), widget);
 
   g_signal_connect (G_OBJECT (widget), "toggled",
@@ -394,11 +394,11 @@ focus_iconview (gboolean color_bg, GtkCellRenderer **focus, GtkCellRenderer **si
 }
 
 static void
-focus_sibling_toggled (GtkToggleButton  *toggle,
+focus_sibling_toggled (GtkCheckButton  *toggle,
                       GtkIconView *iconview)
 {
   GtkCellArea *area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (iconview));
-  gboolean     active = gtk_toggle_button_get_active (toggle);
+  gboolean     active = gtk_check_button_get_active (toggle);
 
   if (active)
     gtk_cell_area_add_focus_sibling (area, focus_renderer, sibling_renderer);
@@ -445,7 +445,7 @@ focus_cell_area (void)
                     G_CALLBACK (orientation_changed), iconview);
 
   widget = gtk_check_button_new_with_label ("Focus Sibling");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (widget), TRUE);
   gtk_box_append (GTK_BOX (vbox), widget);
 
   g_signal_connect (G_OBJECT (widget), "toggled",
diff --git a/tests/testinhibitshortcuts.c b/tests/testinhibitshortcuts.c
index caecf43751..62d59047c5 100644
--- a/tests/testinhibitshortcuts.c
+++ b/tests/testinhibitshortcuts.c
@@ -30,10 +30,10 @@ on_shortcuts_inhibit_change (GdkSurface *surface, GParamSpec *pspec, gpointer da
 
   gtk_check_button_set_inconsistent (GTK_CHECK_BUTTON (button), FALSE);
 
-  button_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+  button_active = gtk_check_button_get_active (GTK_CHECK_BUTTON (button));
 
   if (button_active != shortcuts_inhibited)
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), shortcuts_inhibited);
+    gtk_check_button_set_active (GTK_CHECK_BUTTON (button), shortcuts_inhibited);
 }
 
 static void
@@ -41,7 +41,7 @@ on_button_toggle (GtkWidget *button, gpointer data)
 {
   GdkSurface *surface = GDK_SURFACE (data);
 
-  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+  if (!gtk_check_button_get_active (GTK_CHECK_BUTTON (button)))
     {
       gdk_toplevel_restore_system_shortcuts (GDK_TOPLEVEL (surface));
       return;
diff --git a/tests/testlist.c b/tests/testlist.c
index 285aaa74da..44cdbc9c9c 100644
--- a/tests/testlist.c
+++ b/tests/testlist.c
@@ -238,8 +238,8 @@ single_click_clicked (GtkButton *check, gpointer data)
 {
   GtkListBox *list = data;
 
-  g_print ("single: %d\n", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
-  gtk_list_box_set_activate_on_single_click (list, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
+  g_print ("single: %d\n", gtk_check_button_get_active (GTK_CHECK_BUTTON (check)));
+  gtk_list_box_set_activate_on_single_click (list, gtk_check_button_get_active (GTK_CHECK_BUTTON (check)));
 }
 
 int
@@ -278,7 +278,7 @@ main (int argc, char *argv[])
   gtk_box_append (GTK_BOX (vbox), combo);
   gtk_combo_box_set_active (GTK_COMBO_BOX (combo), gtk_list_box_get_selection_mode (GTK_LIST_BOX (list)));
   check = gtk_check_button_new_with_label ("single click mode");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gtk_list_box_get_activate_on_single_click 
(GTK_LIST_BOX (list)));
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (check), gtk_list_box_get_activate_on_single_click 
(GTK_LIST_BOX (list)));
   g_signal_connect (check, "toggled", G_CALLBACK (single_click_clicked), list);
   gtk_box_append (GTK_BOX (vbox), check);
 
diff --git a/tests/testlockbutton.c b/tests/testlockbutton.c
index 9832bb53cf..ff7599b65f 100644
--- a/tests/testlockbutton.c
+++ b/tests/testlockbutton.c
@@ -180,10 +180,10 @@ update_clicked (GtkButton *button, GtkLockButton *lockbutton)
 
   permission = gtk_lock_button_get_permission (lockbutton);
 
-  allowed = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (allowed_button));
-  can_acquire = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (can_acquire_button));
-  can_release = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (can_release_button));
-  success = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (success_button));
+  allowed = gtk_check_button_get_active (GTK_CHECK_BUTTON (allowed_button));
+  can_acquire = gtk_check_button_get_active (GTK_CHECK_BUTTON (can_acquire_button));
+  can_release = gtk_check_button_get_active (GTK_CHECK_BUTTON (can_release_button));
+  success = gtk_check_button_get_active (GTK_CHECK_BUTTON (success_button));
   g_permission_impl_update (permission, allowed, can_acquire, can_release);
   g_test_permission_set_success (G_TEST_PERMISSION (permission), success);
 }
@@ -202,9 +202,9 @@ permission_changed (GPermission *permission,
                 "can-release", &can_release,
                 NULL);
 
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (allowed_button), allowed);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (can_acquire_button), can_acquire);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (can_release_button), can_release);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (allowed_button), allowed);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (can_acquire_button), can_acquire);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (can_release_button), can_release);
 
   gtk_widget_set_sensitive (content, allowed);
 }
diff --git a/tests/testpopover.c b/tests/testpopover.c
index e9e0a1c580..cdd09de99b 100644
--- a/tests/testpopover.c
+++ b/tests/testpopover.c
@@ -150,7 +150,7 @@ main (int argc, char *argv[])
   g_object_bind_property (check, "active", popover, "autohide", G_BINDING_SYNC_CREATE);
   g_object_bind_property (check, "active", popover1, "autohide", G_BINDING_SYNC_CREATE);
   g_object_bind_property (check, "active", popover2, "autohide", G_BINDING_SYNC_CREATE);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (check), TRUE);
   gtk_grid_attach (GTK_GRID (grid), label , 1, 3, 1, 1);
   gtk_grid_attach (GTK_GRID (grid), check, 2, 3, 1, 1);
 
diff --git a/tests/testselectionmode.c b/tests/testselectionmode.c
index b001e253c5..823663396a 100644
--- a/tests/testselectionmode.c
+++ b/tests/testselectionmode.c
@@ -59,11 +59,11 @@ update_selected (GtkWidget *widget)
 
   if (gtk_list_box_row_is_selected (GTK_LIST_BOX_ROW (row)))
     {
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (row->check), TRUE);
+      gtk_check_button_set_active (GTK_CHECK_BUTTON (row->check), TRUE);
       gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_SELECTED);
     }
   else
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (row->check), FALSE);
+    gtk_check_button_set_active (GTK_CHECK_BUTTON (row->check), FALSE);
 }
 
 static void
diff --git a/tests/teststack.c b/tests/teststack.c
index 70931fa20f..d1deaacf34 100644
--- a/tests/teststack.c
+++ b/tests/teststack.c
@@ -20,14 +20,14 @@ set_visible_child_name (GtkWidget *button, gpointer data)
 static void
 toggle_hhomogeneous (GtkWidget *button, gpointer data)
 {
-  gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+  gboolean active = gtk_check_button_get_active (GTK_CHECK_BUTTON (button));
   gtk_stack_set_hhomogeneous (GTK_STACK (stack), active);
 }
 
 static void
 toggle_vhomogeneous (GtkWidget *button, gpointer data)
 {
-  gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+  gboolean active = gtk_check_button_get_active (GTK_CHECK_BUTTON (button));
   gtk_stack_set_vhomogeneous (GTK_STACK (stack), active);
 }
 
@@ -215,14 +215,14 @@ main (int argc,
   g_signal_connect (button, "clicked", (GCallback) set_visible_child_name, (gpointer) "3");
 
   button = gtk_check_button_new ();
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
-                               gtk_stack_get_hhomogeneous (GTK_STACK (stack)));
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (button),
+                               gtk_stack_get_hhomogeneous (GTK_STACK (stack)));
   gtk_box_append (GTK_BOX (hbox), button);
   g_signal_connect (button, "clicked", (GCallback) toggle_hhomogeneous, NULL);
 
   button = gtk_check_button_new_with_label ("homogeneous");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
-                               gtk_stack_get_vhomogeneous (GTK_STACK (stack)));
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (button),
+                               gtk_stack_get_vhomogeneous (GTK_STACK (stack)));
   gtk_box_append (GTK_BOX (hbox), button);
   g_signal_connect (button, "clicked", (GCallback) toggle_vhomogeneous, NULL);
 
diff --git a/tests/testtreeedit.c b/tests/testtreeedit.c
index d47a35b5a6..984cc21355 100644
--- a/tests/testtreeedit.c
+++ b/tests/testtreeedit.c
@@ -209,7 +209,7 @@ create_control (GtkWidget *box, int number, int cntl, CallbackData *data)
     }
 
   checkbutton = gtk_check_button_new_with_label (name);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), cntl == CNTL_FIXED);
+  gtk_check_button_set_active (GTK_CHECK_BUTTON (checkbutton), cntl == CNTL_FIXED);
   gtk_box_append (GTK_BOX (box), checkbutton);
 
   g_signal_connect (G_OBJECT (checkbutton), "toggled", callback, data);
diff --git a/tests/testwindowsize.c b/tests/testwindowsize.c
index 8e2a1afd02..e6539c7ae0 100644
--- a/tests/testwindowsize.c
+++ b/tests/testwindowsize.c
@@ -30,7 +30,7 @@ show_dialog (void)
   max_width_chars = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (max_width_chars_spin));
   default_width = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (default_width_spin));
   default_height = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (default_height_spin));
-  resizable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (resizable_check));
+  resizable = gtk_check_button_get_active (GTK_CHECK_BUTTON (resizable_check));
 
   dialog = gtk_dialog_new_with_buttons ("Test", GTK_WINDOW (window),
                                         GTK_DIALOG_MODAL,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]