print-editor: Deprecation cleanup
authorMatthias Clasen <mclasen@redhat.com>
Thu, 3 Aug 2023 21:27:32 +0000 (17:27 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Aug 2023 02:15:27 +0000 (22:15 -0400)
Drop all uses of deprecated API.

demos/print-editor/print-editor.c

index ceefdd784be6ff9c43a64ed4dcd61afbcc8084c0..792f01cfbbd4b2c723a4988d0c0c62e1e87f42ab 100644 (file)
@@ -6,8 +6,6 @@
 
 #include "demo_conf.h"
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-
 static GtkWidget *main_window;
 static GFile *filename = NULL;
 static GtkPageSetup *page_setup = NULL;
@@ -43,7 +41,7 @@ update_statusbar (void)
   GtkTextIter iter;
   const char *print_str;
 
-  gtk_statusbar_pop (GTK_STATUSBAR (statusbar), 0);
+  gtk_label_set_label (GTK_LABEL (statusbar), "");
 
   gtk_text_buffer_get_iter_at_mark (buffer,
                                     &iter,
@@ -61,10 +59,10 @@ update_statusbar (void)
 
   msg = g_strdup_printf ("%d, %d%s %s",
                          row, col,
-                        file_changed?" - Modified":"",
-                        print_str);
+                         file_changed?" - Modified":"",
+                         print_str);
 
-  gtk_statusbar_push (GTK_STATUSBAR (statusbar), 0, msg);
+  gtk_label_set_label (GTK_LABEL (statusbar), msg);
 
   g_free (msg);
 }
@@ -827,7 +825,12 @@ activate (GApplication *app)
                      contents);
 
   /* Create statusbar */
-  statusbar = gtk_statusbar_new ();
+  statusbar = gtk_label_new ("");
+  gtk_label_set_xalign (GTK_LABEL (statusbar), 0);
+  gtk_widget_set_margin_start (statusbar, 2);
+  gtk_widget_set_margin_end (statusbar, 2);
+  gtk_widget_set_margin_top (statusbar, 2);
+  gtk_widget_set_margin_bottom (statusbar, 2);
   gtk_box_append (GTK_BOX (box), statusbar);
 
   /* Show text widget info in the statusbar */